Follow-up from the native fetch() polyfill review (#188).
UrlLib currently exposes only the numeric HTTP status code. To provide Response.statusText, the Fetch polyfill added a hardcoded code→text table (StatusText in Polyfills/Fetch/Source/Fetch.cpp) that returns "" for any code not in the table.
This mapping belongs in UrlLib instead:
- Expose the real reason phrase from the transport where the wire carries one (HTTP/1.x).
- Fall back to a code→text table for HTTP/2+ where the status line carries no reason phrase.
Doing this in UrlLib would also let XMLHttpRequest — which currently has no statusText — expose one for free, and remove the per-polyfill table.
Follow-up from the native
fetch()polyfill review (#188).UrlLibcurrently exposes only the numeric HTTP status code. To provideResponse.statusText, the Fetch polyfill added a hardcoded code→text table (StatusTextinPolyfills/Fetch/Source/Fetch.cpp) that returns""for any code not in the table.This mapping belongs in
UrlLibinstead:Doing this in
UrlLibwould also letXMLHttpRequest— which currently has nostatusText— expose one for free, and remove the per-polyfill table.