Skip to content

UrlLib: expose HTTP status reason phrase (statusText) #193

Description

@bkaradzic-microsoft

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions