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

Improve origin support #272

Open
sandstrom opened this issue Sep 23, 2017 · 0 comments
Open

Improve origin support #272

sandstrom opened this issue Sep 23, 2017 · 0 comments
Labels

Comments

@sandstrom
Copy link

sandstrom commented Sep 23, 2017

Thanks for a great library ⛵

Retrieving origin works:

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

But setting origin via the hash, or directly, doesn't work:

# desired behaviour
uri = Addressable::URI.new(:origin => 'https://google.com:8080')
uri.port #=> 8080
uri.origin #=> "https://google.com:8080"

# current behaviour
uri = Addressable::URI.new #=> #<Addressable::URI:0x3fc63817e894 URI:>
uri.origin = "http://newexample.com"
# throws Addressable::URI::InvalidURIError: Absolute URI missing hierarchical segment: 'http:'

Addressable::URI.new(:origin => 'https://google.com').to_s == '' # unexpected

This is under version 2.5.1.

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

2 participants