fix: Use lower-case proxy headers naming (#21235)
This commit is contained in:
parent
6307ec07d3
commit
0fcb3760b2
File diff suppressed because one or more lines are too long
|
|
@ -18,7 +18,7 @@
|
|||
<div style="display: contents">
|
||||
<script>
|
||||
{
|
||||
__sveltekit_1snwavw = {
|
||||
__sveltekit_1trm5n9 = {
|
||||
base: new URL('.', location).pathname.slice(0, -1)
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ static server_http_res_ptr proxy_request(const server_http_req & req, std::strin
|
|||
std::map<std::string, std::string> headers;
|
||||
for (auto [key, value] : req.headers) {
|
||||
auto new_key = key;
|
||||
if (string_starts_with(new_key, "X-Proxy-Header-")) {
|
||||
string_replace_all(new_key, "X-Proxy-Header-", "");
|
||||
if (string_starts_with(new_key, "x-proxy-header-")) {
|
||||
string_replace_all(new_key, "x-proxy-header-", "");
|
||||
}
|
||||
headers[new_key] = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export function buildProxiedHeaders(headers: Record<string, string>): Record<str
|
|||
const proxiedHeaders: Record<string, string> = {};
|
||||
|
||||
for (const [key, value] of Object.entries(headers)) {
|
||||
proxiedHeaders[`X-Proxy-Header-${key}`] = value;
|
||||
proxiedHeaders[`x-proxy-header-${key}`] = value;
|
||||
}
|
||||
|
||||
return proxiedHeaders;
|
||||
|
|
|
|||
Loading…
Reference in New Issue