-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support Opaque origin headers, serializing it to null
#1065
Comments
Sorry, in what context? The url? The |
The origin header. |
null
null
null
null
I see. So it can either be pub struct Origin(OriginOrNull);
enum OriginOrNull {
Origin {
scheme: String,
host: Host,
},
Null,
}
impl Origin {
pub fn new<S: Into<String>, H: Into<String>>(scheme: S, hostname: H, port: Option<u16>) -> Origin{
Origin(OriginOrNull::Origin {
scheme: scheme.into(),
host: Host::new(hostname.into(), port),
})
}
pub fn null() -> Origin {
Origin(OriginOrNull::Null)
}
pub fn is_null(&self) -> bool;
pub fn scheme(&self) -> Option<&str>;
pub fn hostname(&self) -> Option<&str>;
pub fn port(&self) -> Option<u16>;
} Whatcha think? For servo, if you wish to make use of this right away while keeping to hyper 0.10, you could implement an |
@seanmonstar That looks real similar to the Ah, I might implement |
Oh I remember this conversation again. We didn't use |
Thanks to work in #1121, the breaking change required here is done. This would be pretty easy to implement using an internal private enum, as described in #1065 (comment), keeping our use of |
Hi there! I'd like to try implementing this. |
Add support for Opaque origin header, serializing it to `null`. https://html.spec.whatwg.org/multipage/browsers.html#concept-origin Closes hyperium#1065
Add support for Opaque origin header, serializing it to `null`. https://html.spec.whatwg.org/multipage/browsers.html#concept-origin Closes hyperium#1065
Add support for Opaque origin header, serializing it to `null`. https://html.spec.whatwg.org/multipage/browsers.html#concept-origin Closes #1065 BREAKING CHANGE: `Origin.scheme` and `Origin.host` now return `Option`s, since the `Origin` could be `null`.
Add support for Opaque origin header, serializing it to `null`. https://html.spec.whatwg.org/multipage/browsers.html#concept-origin Closes hyperium#1065 BREAKING CHANGE: `Origin.scheme` and `Origin.host` now return `Option`s, since the `Origin` could be `null`.
Support Opaque origins:
https://html.spec.whatwg.org/multipage/browsers.html#concept-origin
The text was updated successfully, but these errors were encountered: