Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplemented the origin method (fixes #54) #111
Conversation
|
Are we sure that the port will always be the default one? With a quick look at the code that seems to be the case. Otherwise lgtm. Generating guids probably can be done with https://crates.io/crates/uuid. |
0d77c13
to
b63effc
|
@Manishearth Where do you see that port always return the default one? |
|
As in the port included in a URL that didn't specifically say one. |
|
Good catch, there's a method called port_or_default |
That’s unclear to me. I’ve filed whatwg/url#21 on the spec. |
|
I think that "globally unique identifiers" for the purpose of URL origins are not UUIDs, but are the same as "opaque identifier" as defined in HTML: https://html.spec.whatwg.org/multipage/browsers.html#origin |
|
I don't know; Blob URIs use GUIDs I think. |
|
@Manishearth [citation needed] :) |
|
Hmm... how exactly do we implement opaque identifiers?
|
|
Unclear to me. I’m trying to figure this out: whatwg/url#21 |
Would a wrapped 256-bit hash (or something) do? |
|
A hash of what data? |
|
Oh, sorry, I got confused there. We could just hash random values but we're back to GUIDs. Really, we can just use uuid or similar to create a number and then wrap the number in an opaque (except for PartialEq/Eq) tuple struct. |
|
What exactly is this opaque tuple struct? How does it look like? Does my current implementation suffice? |
|
Inner value is private, thus, opaque. -----Original Message----- What exactly is this opaque tuple struct? How does it look like? Does my current implementation suffice? |
6c0660f
to
08ea09c
|
r? @SimonSapin |
|
This still seems very wrong to me, but apparently generating a new random identifier every time the method is called is indeed intentional: whatwg/url#56 @bors-servo r+ |
|
|
Implemented the origin method (fixes #54) Fixes #54, but still need some clarafication as to how to generate a GUID for schemes such as blob, file and others. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/111) <!-- Reviewable:end -->
|
|
KiChjang commentedMay 17, 2015
Fixes #54, but still need some clarafication as to how to generate a GUID for schemes such as blob, file and others.