mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-29 23:19:08 +01:00
Forgot about blueprints
This commit is contained in:
@@ -210,8 +210,16 @@ export async function updateProxyResources(
|
||||
? true
|
||||
: resourceData.ssl;
|
||||
let headers = "";
|
||||
if (resourceData.headers) {
|
||||
headers = JSON.stringify(resourceData.headers);
|
||||
const requestHeadersData = [
|
||||
...(resourceData.headers ?? []),
|
||||
...(resourceData.requestHeaders ?? [])
|
||||
];
|
||||
if (requestHeadersData.length > 0) {
|
||||
headers = JSON.stringify(requestHeadersData);
|
||||
}
|
||||
let responseHeaders = "";
|
||||
if (resourceData.responseHeaders) {
|
||||
responseHeaders = JSON.stringify(resourceData.responseHeaders);
|
||||
}
|
||||
|
||||
if (existingResource) {
|
||||
@@ -265,7 +273,8 @@ export async function updateProxyResources(
|
||||
]
|
||||
? resourceData.auth["whitelist-users"].length > 0
|
||||
: false,
|
||||
headers: headers || null,
|
||||
requestHeaders: headers || null,
|
||||
responseHeaders: responseHeaders || null,
|
||||
applyRules:
|
||||
resourceData.rules && resourceData.rules.length > 0,
|
||||
maintenanceModeEnabled:
|
||||
@@ -724,7 +733,8 @@ export async function updateProxyResources(
|
||||
setHostHeader: resourceData["host-header"] || null,
|
||||
tlsServerName: resourceData["tls-server-name"] || null,
|
||||
ssl: resourceSsl,
|
||||
headers: headers || null,
|
||||
requestHeaders: headers || null,
|
||||
responseHeaders: responseHeaders || null,
|
||||
applyRules:
|
||||
resourceData.rules && resourceData.rules.length > 0,
|
||||
maintenanceModeEnabled: resourceData.maintenance?.enabled,
|
||||
|
||||
@@ -175,7 +175,9 @@ export const ResourceSchema = z
|
||||
auth: AuthSchema.optional(),
|
||||
"host-header": z.string().optional(),
|
||||
"tls-server-name": z.string().optional(),
|
||||
headers: z.array(HeaderSchema).optional(),
|
||||
headers: z.array(HeaderSchema).optional(), // deprecated alias for requestHeaders
|
||||
requestHeaders: z.array(HeaderSchema).optional(),
|
||||
responseHeaders: z.array(HeaderSchema).optional(),
|
||||
rules: z.array(RuleSchema).optional(),
|
||||
maintenance: MaintenanceSchema.optional()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user