You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from the audit done while fixing #34 / #35. Several fetch-like APIs still deviate from MDN / WHATWG Fetch behavior or from browser behavior in ways that should be reviewed separately from the narrow Headers(Headers) fix.
This issue is now a tracking index. Use the split issues below for investigation and implementation discussion.
Headers.entries() / Headers.values() on the native implementation expose the raw header list. Browser Headers combines repeated non-set-cookie values while preserving set-cookie values separately, so native and JS behavior can diverge. Tracked in Align native Headers iteration with Fetch semantics #37.
Request / Response constructors do not automatically set Content-Type from the body type when init headers omit it. Browser behavior sets values such as text/plain;charset=UTF-8 for string bodies and application/x-www-form-urlencoded;charset=UTF-8 for URLSearchParams bodies. Tracked in Set default Content-Type from Request and Response body init #38.
Blob, File, and Blob.slice(..., contentType) preserve the supplied type string verbatim. Browser/File API behavior lowercases ASCII MIME types and uses an empty string when the supplied type contains invalid characters. Tracked in Normalize Blob and File MIME type inputs #39.
IO/JS wrapper Response(Response, init) currently aliases the wrapped response host and ignores init. Since this is not a standard Response() constructor shape, decide whether to remove it or define it as clone/copy semantics. Tracked in Define wrapper Response(Response, init) semantics #41.
RequestInit.method is represented as HttpMethod, and newer Request/RequestInit fields such as signal, priority, and targetAddressSpace are not represented. This may be acceptable as a scoped API choice, but should be explicit if MDN surface parity is the goal. Tracked in Decide RequestInit method and modern Fetch surface parity #42.
Problem
Follow-up from the audit done while fixing #34 / #35. Several fetch-like APIs still deviate from MDN / WHATWG Fetch behavior or from browser behavior in ways that should be reviewed separately from the narrow
Headers(Headers)fix.This issue is now a tracking index. Use the split issues below for investigation and implementation discussion.
Split issues
Original findings
Headers.entries()/Headers.values()on the native implementation expose the raw header list. BrowserHeaderscombines repeated non-set-cookievalues while preservingset-cookievalues separately, so native and JS behavior can diverge. Tracked in Align native Headers iteration with Fetch semantics #37.Request/Responseconstructors do not automatically setContent-Typefrom the body type when init headers omit it. Browser behavior sets values such astext/plain;charset=UTF-8for string bodies andapplication/x-www-form-urlencoded;charset=UTF-8forURLSearchParamsbodies. Tracked in Set default Content-Type from Request and Response body init #38.Blob,File, andBlob.slice(..., contentType)preserve the supplied type string verbatim. Browser/File API behavior lowercases ASCII MIME types and uses an empty string when the supplied type contains invalid characters. Tracked in Normalize Blob and File MIME type inputs #39.Response.json()defaults toapplication/json; charset=utf-8; Fetch usesapplication/jsonunless callers explicitly provide a content type. Tracked in Align Response.json default Content-Type with Fetch #40.Response(Response, init)currently aliases the wrapped response host and ignores init. Since this is not a standardResponse()constructor shape, decide whether to remove it or define it as clone/copy semantics. Tracked in Define wrapper Response(Response, init) semantics #41.RequestInit.methodis represented asHttpMethod, and newer Request/RequestInit fields such assignal,priority, andtargetAddressSpaceare not represented. This may be acceptable as a scoped API choice, but should be explicit if MDN surface parity is the goal. Tracked in Decide RequestInit method and modern Fetch surface parity #42.References
Current validation context
At the time of this audit, the existing test suite passed:
dart analyzedart test