-
-
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
Origin Header #651
Comments
Is this in common use? I've never used it myself, and when checking the dev consoles, I notice neither Firefox nor Chrome set that header while browsing. |
The Origin header is set for CORS requests. On 15 October 2015 01:36:27 CEST, Sean McArthur notifications@github.com wrote:
Sent from my phone. Please excuse my brevity. |
Ah yes, quite true. I had forgotten. |
@seanmonstar Is anyone working on this? If not I'd be interested in giving it a go |
Go for it! On Thu, Nov 19, 2015 at 4:56 AM Martin Feckie notifications@github.com
|
I don't think anybody is working on this. On Thu, Nov 19, 2015 at 04:56:13AM -0800, Martin Feckie wrote:
|
Would love to get newly-rusty hands wet; what's going on here? A variety of PRs have been closed, and one (to another project?) |
I think the main discussion is under #691, basically we waited until rust-url was 1.0 (where its Origin type was rewritten) and then forgot about it. On 5 July 2016 01:21:00 EEST, Michael Perez notifications@github.com wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
The current type in rust-url is an enum with an pub struct Origin(String, String, Option<u16>);
// support default ports
impl PartialEq for Origin {
fn eq(&self, other: &Origin) -> bool {
if self.0 == other.0 && self.1 == other.1 {
self.2.or_else(|| default_port(&self.0)) == other.2.or_else(|| default_port(&other.0))
}
false
}
}
fn default_port(scheme: &str) -> Option<u16> {
match scheme {
"http" => Some(80),
"https" => Some(443),
_ => None,
}
} |
@seanmonstar that seems good for a single "serialized-origin". I'm not very familiar with things (in general) but according to the spec the value of an Origin header may actually be a vec of this implementation of Origin. Aside from that in order to parse/generate, after having read the docs the also aside: y use |
@puhrez since the Origin header only makes in CORS requests, may as well use the definition from the most up-to-date spec governing them: https://fetch.spec.whatwg.org/#origin-header In that spec, the Yes, a header needs to implement A |
Ah yes, I knew it meant unsigned but for some reason (not being very used to re
UPDATE:
since the optional port is not a string, do we have to implement the on second though, perhaps it can use
|
started a pull request incorporating my comments above as well as trying to conform to contribution style, haven't tested it well (read: at all) yet tho :). used |
Add an Origin header so users may properly send CORS requests Closes #651
Add an Origin header so users may properly send CORS requests Closes #651
It seems like the "Origin" header is missing here
http://tools.ietf.org/id/draft-abarth-origin-03.html
The text was updated successfully, but these errors were encountered: