mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 02:59:45 +00:00
LibWeb: Don't strip leading '?' in query initializing a URL
In our implementation of url-initialize, we were invoking the constructor of URLSearchParams: https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams Instead of the 'initialize' AO: https://url.spec.whatwg.org/#urlsearchparams-initialize This has the small difference of stripping any leading '?' from the query (which we are not meant to be doing!).
This commit is contained in:
parent
d7b19b3278
commit
fd4e943e12
Notes:
github-actions[bot]
2024-08-06 22:09:12 +00:00
Author: https://github.com/shannonbooth
Commit: fd4e943e12
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/987
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 34 additions and 2 deletions
|
@ -152,6 +152,17 @@ pathname => '/test'
|
|||
search => '?test'
|
||||
searchParams => 'test='
|
||||
hash => ''
|
||||
new URL('??a=b&c=d', 'http://example.org/foo/bar')
|
||||
protocol => 'http:'
|
||||
username => ''
|
||||
password => ''
|
||||
host => 'example.org'
|
||||
hostname => 'example.org'
|
||||
port => ''
|
||||
pathname => '/foo/bar'
|
||||
search => '??a=b&c=d'
|
||||
searchParams => '%3Fa=b&c=d'
|
||||
hash => ''
|
||||
=========================================
|
||||
URL.parse('ftp://serenityos.org:21', undefined)
|
||||
protocol => 'ftp:'
|
||||
|
@ -307,3 +318,14 @@ pathname => '/test'
|
|||
search => '?test'
|
||||
searchParams => 'test='
|
||||
hash => ''
|
||||
URL.parse('??a=b&c=d', 'http://example.org/foo/bar')
|
||||
protocol => 'http:'
|
||||
username => ''
|
||||
password => ''
|
||||
host => 'example.org'
|
||||
hostname => 'example.org'
|
||||
port => ''
|
||||
pathname => '/foo/bar'
|
||||
search => '??a=b&c=d'
|
||||
searchParams => '%3Fa=b&c=d'
|
||||
hash => ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue