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

url.set() doesn't work as expected with property 'origin' #182

Open
egold opened this issue Sep 13, 2019 · 2 comments
Open

url.set() doesn't work as expected with property 'origin' #182

egold opened this issue Sep 13, 2019 · 2 comments

Comments

@egold
Copy link

egold commented Sep 13, 2019

Very simple test:

const url = new Url("http://www.example.com/foo/bar");
url.set('origin', 'https://anotherorigin.com')
console.log('URL origin:', url.origin);
//Expected value: https://anotherorigin.com
//Actual value: http://www.example.com

Does not behave as described in documentation. Unless origin is an exception case for some reason, in which case it should be documented.

I get that it would be, since origin is a combination of other properties, but some warning/exception against using .set('origin') (OK) or support for being able to set it (better) would be great.

FWIW same thing happens using parse() code path:

var parsed = parse('http://www.example.com/foo/bar')
parsed.set('origin', 'https://anotherorigin.com')
console.log('Parsed:', parsed)
//Expected value: https://anotherorigin.com
//Actual value: http://www.example.com
@egold egold changed the title url.set() doesn't work as expected with property 'origin' url.set() doesn't work as expected with property 'origin' Sep 13, 2019
@mspaansen
Copy link

Test

@dontbesatisfied
Copy link

I'd like to know when it'll be fixed

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

No branches or pull requests

3 participants