Closed
Description
- Version: 15.3.0
- Platform: Windows 64-bit
- Subsystem: WHATWG-URL
What steps will reproduce the bug?
const url = require('url');
let href = new URL('https://127.0.0.1/v1/users?');
console.log(href);
How often does it reproduce? Is there a required condition?
It does reproduce every single time.
What is the expected behavior?
I really expect that the URL contains in the search
-attribute a single question mark.
URL {
href: 'https://127.0.0.1/v1/users?',
origin: 'https://127.0.0.1',
protocol: 'https:',
username: '',
password: '',
host: '127.0.0.1',
hostname: '127.0.0.1',
port: '',
pathname: '/v1/users',
search: '?',
searchParams: URLSearchParams {},
hash: ''
}
What do you see instead?
I see instead the search
-attribute with an empty string.
URL {
href: 'https://127.0.0.1/v1/users?',
origin: 'https://127.0.0.1',
protocol: 'https:',
username: '',
password: '',
host: '127.0.0.1',
hostname: '127.0.0.1',
port: '',
pathname: '/v1/users',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
Additional information
I need this missing feature for my automated API testing.