This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export interface IncomingRequestCfProperties {
2626 asn : number ;
2727 botManagement ?: IncomingRequestCfPropertiesBotManagement ;
2828 city ?: string ;
29- clientAcceptEncoding ?: string | string [ ] ;
29+ clientAcceptEncoding ?: string ;
3030 clientTcpRtt : number ;
3131 clientTrustScore ?: number ;
3232 colo : string ;
Original file line number Diff line number Diff line change @@ -114,9 +114,12 @@ export async function convertNodeRequest(
114114 req . headers [ "cf-visitor" ] ??= `{"scheme":"${ proto } "}` ;
115115 req . headers [ "host" ] = url . host ;
116116
117- // Keep it to use later
117+ // Store original `Accept-Encoding` for `request.cf.clientAcceptEncoding`
118118 const clientAcceptEncoding = req . headers [ "accept-encoding" ] ;
119- // This should be fixed
119+ // Only the `Set-Cookie` header is an array: https://nodejs.org/api/http.html#messageheaders
120+ assert ( ! Array . isArray ( clientAcceptEncoding ) ) ;
121+ // The Workers runtime will always set `Accept-Encoding` to `gzip`:
122+ // https://github.com/cloudflare/miniflare/issues/180
120123 req . headers [ "accept-encoding" ] = "gzip" ;
121124
122125 // Build Headers object from request
You can’t perform that action at this time.
0 commit comments