fix: signature header request

This commit is contained in:
2026-08-16 14:12:46 +07:00
parent ffe9269bb5
commit e45c5bcabd
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -64,6 +64,12 @@ async function createCanonicalRequest(request: Request, isQueryAuth: boolean): P
if (port && !((url.protocol === "https:" && port === "443") || (url.protocol === "http:" && port === "80"))) {
headerValue += `:${port}`;
}
} else if (headerName === "accept-encoding") {
// Cloudflare's edge rewrites the incoming Accept-Encoding value before the Worker
// sees it, so the literal value can never be recovered here. S3 SDKs that sign this
// header (aws-sdk-go, used by rclone/mc) always set it to "identity" beforehand, since
// S3 doesn't support transparent content-encoding on object bodies.
headerValue = "identity";
} else {
headerValue = request.headers.get(headerName)?.trim() ?? "";
}