Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels