-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(headers): use String in Access-Control-Allow-Origin header
Access-Control-Allow-Origin origins are URLs but they do not need to be valid, they should just be compared as strings. So to support invalid URLs hyper should use a string instead. closes #526 BREAKING CHANGE: Access-Control-Allow-Origin does no longer use Url
- Loading branch information
Showing
2 changed files
with
19 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ed45862
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note also that by definition an origin (even when serialized) is not a URL. You might be able to parse it as one, but if you then serialize it you'll get a slightly different result.
ed45862
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Would you change something about the code? Maybe you could add a note to the docs?
ed45862
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would not even store utf-8, just the raw bytes. If you want anything changed in https://fetch.spec.whatwg.org/ please file an issue against the GitHub repository.