Repository navigation
headers v1.1.1
Patch Changes
-
Fix
Accept,Accept-EncodingandAccept-Languageweights when several header entries match a value.getWeight(),accepts()andgetPreferred()now prefer an exact entry, then the most specific matching range, as RFC 9110 requires. Previously the highest-weighted match won, soAccept-Encoding: gzip;q=0, *reportedgzipas acceptable andAccept-Language: en;q=0, en-USreportedenas acceptable. (#12297)Accept-Languageranges now match by full subtag prefix, sozh-Hant-TWno longer matcheszh-Hant-CN.AcceptEncoding#accepts('identity')now returnsfalsewhen the header refusesidentitywithidentity;q=0, or with*;q=0and noidentityentry. It still returnstruewhenidentityis not mentioned. -
CacheControl.from()no longer drops directives whose names aren't lowercase, such asNo-StoreorMAX-AGE=60. (#12237) -
Varykeeps header names as they were first given instead of lowercasing them, socompression()andcors()no longer rewriteVary: CookietoVary: cookie. Safari only varies its cache on cookies when the name is spelledCookie, so the lowercased value could let it reuse a private response for a different session. (#12271) -
Varytreats*as varying on everything, socompression()andcors()no longer turnVary: *into an invalid value likeVary: *, Accept-Encoding. (#12273)