fix: Use lower-case proxy headers naming (#21235)

This commit is contained in:
Aleksander Grygier 2026-03-31 17:47:46 +02:00 committed by GitHub
parent 6307ec07d3
commit 0fcb3760b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@
<div style="display: contents">
<script>
{
__sveltekit_1snwavw = {
__sveltekit_1trm5n9 = {
base: new URL('.', location).pathname.slice(0, -1)
};

View File

@ -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;
}

View File

@ -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;