Repository navigation
headers v1.1.2
Patch Changes
-
Replace the internal
Proxywrapper inSuperHeaderswith direct mutation tracking on typed header accessors. Collection headers (Accept,AcceptEncoding,AcceptLanguage,Cookie, andVary) now return the real header instances directly with preservedthisidentity, and property-style and list accessors avoid per-accessProxy,WeakMap, and bound-function overhead. (#12495)Because
SuperHeadersno longer wraps parsed values in aProxy, mutations that previously relied onProxytraps—deleteandObject.defineProperty()on typed header fields, direct bracket-index assignment (arr[i] = ...) or.lengthtruncation on list accessors (headers.setCookie,headers.ifMatch.tags,headers.ifNoneMatch.tags,headers.range.ranges), and own-property enumeration (Object.keys(), object spread,JSON.stringify()) onSuperHeadersproperty wrappers—are no longer intercepted (standalone header classes such asnew ContentType()andnew IfRange()are unchanged). Assignundefinedto clear typed fields and use standard array methods to update list accessors:-delete headers.contentType.charset -headers.setCookie[1] = { name: 'lang', value: 'en' } +headers.contentType.charset = undefined +headers.setCookie.splice(1, 1, { name: 'lang', value: 'en' })