mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 10:18:59 +00:00
LibURL: Don't consider file:// URL hosts as always opaque
Which was resulting in file URL hosts not being correctly percent decoded.
This commit is contained in:
parent
dd7c720657
commit
a661daea71
Notes:
github-actions[bot]
2024-08-04 08:38:21 +00:00
Author: https://github.com/shannonbooth
Commit: a661daea71
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/951
3 changed files with 22 additions and 2 deletions
|
@ -78,6 +78,16 @@ port => ''
|
||||||
pathname => '/d:/'
|
pathname => '/d:/'
|
||||||
search => ''
|
search => ''
|
||||||
hash => ''
|
hash => ''
|
||||||
|
new URL('file://a%C2%ADb/p', undefined)
|
||||||
|
protocol => 'file:'
|
||||||
|
username => ''
|
||||||
|
password => ''
|
||||||
|
host => 'ab'
|
||||||
|
hostname => 'ab'
|
||||||
|
port => ''
|
||||||
|
pathname => '/p'
|
||||||
|
search => ''
|
||||||
|
hash => ''
|
||||||
=========================================
|
=========================================
|
||||||
URL.parse('ftp://serenityos.org:21', undefined)
|
URL.parse('ftp://serenityos.org:21', undefined)
|
||||||
protocol => 'ftp:'
|
protocol => 'ftp:'
|
||||||
|
@ -159,3 +169,13 @@ port => ''
|
||||||
pathname => '/d:/'
|
pathname => '/d:/'
|
||||||
search => ''
|
search => ''
|
||||||
hash => ''
|
hash => ''
|
||||||
|
URL.parse('file://a%C2%ADb/p', undefined)
|
||||||
|
protocol => 'file:'
|
||||||
|
username => ''
|
||||||
|
password => ''
|
||||||
|
host => 'ab'
|
||||||
|
hostname => 'ab'
|
||||||
|
port => ''
|
||||||
|
pathname => '/p'
|
||||||
|
search => ''
|
||||||
|
hash => ''
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
{ input: 'http://serenityos.org/cat?dog#meow"woof' },
|
{ input: 'http://serenityos.org/cat?dog#meow"woof' },
|
||||||
{ input: '/hello', base: 'file://friends/' },
|
{ input: '/hello', base: 'file://friends/' },
|
||||||
{ input: '//d:/..', base: 'file:///C:/a/b' },
|
{ input: '//d:/..', base: 'file:///C:/a/b' },
|
||||||
|
{ input: 'file://a%C2%ADb/p' },
|
||||||
];
|
];
|
||||||
|
|
||||||
for (url of urls) {
|
for (url of urls) {
|
||||||
|
|
|
@ -1485,8 +1485,7 @@ URL Parser::basic_parse(StringView raw_input, Optional<URL> const& base_url, Opt
|
||||||
// 3. Otherwise, run these steps:
|
// 3. Otherwise, run these steps:
|
||||||
else {
|
else {
|
||||||
// 1. Let host be the result of host parsing buffer with url is not special.
|
// 1. Let host be the result of host parsing buffer with url is not special.
|
||||||
// FIXME: It seems we are not passing through url is not special through here
|
auto host = parse_host(buffer.string_view(), !url->is_special());
|
||||||
auto host = parse_host(buffer.string_view(), true);
|
|
||||||
|
|
||||||
// 2. If host is failure, then return failure.
|
// 2. If host is failure, then return failure.
|
||||||
if (!host.has_value())
|
if (!host.has_value())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue