Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider renaming ByteString to HTTPHeaderString? #990

Open
domenic opened this issue Jun 3, 2021 · 2 comments
Open

Consider renaming ByteString to HTTPHeaderString? #990

domenic opened this issue Jun 3, 2021 · 2 comments

Comments

@domenic
Copy link
Member

domenic commented Jun 3, 2021

The only places ByteString is used on the platform are:

  • XHR, Fetch, and Service Worker APIs dealing with HTTP headers
  • The return value of atob.

The latter could be easily converted to a DOMString (since it's a return value this has no change in semantics). And then we could do the proposed rename to make it clear when ByteString is reasonable to use on the web platform.

Thoughts?

@TimothyGu
Copy link
Member

HTTPHeaderString could be a bit confusing. "\x04" is not a valid character in an HTTP header, but is a valid ByteString value.

@annevk
Copy link
Member

annevk commented Jun 4, 2021

I think it's fine to use for all cases where you have a byte sequence and want to return it isomomorphic decoded for convenience. It's typically network APIs that need this as they never adopted Unicode.

E.g., I think https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-nexthopprotocol should use it too. (Tracked in w3c/resource-timing#274.)

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

No branches or pull requests

3 participants