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

Ability to set origin #218

Closed
sandstrom opened this issue Nov 21, 2015 · 5 comments
Closed

Ability to set origin #218

sandstrom opened this issue Nov 21, 2015 · 5 comments
Labels

Comments

@sandstrom
Copy link

This library is awesome ⛵

A small wish is the ability to set origin, for symmetry.

Retrieving origin works:

uri = Addressable::URI.new(:scheme => 'https', :host => 'google.com')
uri.origin #=> "https://google.com"

It would be nice if one could set it too:

uri = Addressable::URI.new(:origin => 'https://google.com:8080')
uri.port #=> 8080
uri.hostname #=> "google.com"
uri.origin #=> "https://google.com:8080"
@sporkmonger
Copy link
Owner

Implemented in b250f42.

@sandstrom
Copy link
Author

@sporkmonger: perhaps I'm missing something obvious, but I cannot get it to work.

uri = Addressable::URI.new #=> #<Addressable::URI:0x3fc63817e894 URI:>
uri.origin = "http://newexample.com"
# throws Addressable::URI::InvalidURIError: Absolute URI missing hierarchical segment: 'http:'
Addressable::VERSION::STRING => "2.4.0"
Addressable::URI.new(:origin => 'https://google.com').to_s #=> ""

@sandstrom
Copy link
Author

Friendly ping @sporkmonger 😄

@dentarg
Copy link
Collaborator

dentarg commented Sep 22, 2017

@sandstrom I think it's best to open a new issue about it

@sandstrom
Copy link
Author

@dentarg Alright, I've opened a new issue here #272 🇸🇪

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

No branches or pull requests

3 participants