mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Correct faulty logic for host state in basic URL parse
The '[' and ']' code points were not being appended to the buffer for this case.
This commit is contained in:
parent
dc27d19b21
commit
16b43ed03e
Notes:
sideshowbarker
2024-07-17 03:16:02 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/16b43ed03e Pull-request: https://github.com/SerenityOS/serenity/pull/19787
1 changed files with 10 additions and 11 deletions
|
@ -681,18 +681,17 @@ URL URLParser::parse(StringView raw_input, Optional<URL> const& base_url, Option
|
|||
|
||||
}
|
||||
// 4. Otherwise:
|
||||
// FIXME: Implement closer to spec text. From reading it, shouldn't we be appending [ or ] to buffer as well? Step 3. below does not have an 'otherwise'.
|
||||
//
|
||||
// 1. If c is U+005B ([), then set insideBrackets to true.
|
||||
else if (code_point == '[') {
|
||||
inside_brackets = true;
|
||||
}
|
||||
// 2. If c is U+005D (]), then set insideBrackets to false.
|
||||
else if (code_point == ']') {
|
||||
inside_brackets = false;
|
||||
}
|
||||
// 3. Append c to buffer.
|
||||
else {
|
||||
// 1. If c is U+005B ([), then set insideBrackets to true.
|
||||
if (code_point == '[') {
|
||||
inside_brackets = true;
|
||||
}
|
||||
// 2. If c is U+005D (]), then set insideBrackets to false.
|
||||
else if (code_point == ']') {
|
||||
inside_brackets = false;
|
||||
}
|
||||
|
||||
// 3. Append c to buffer.
|
||||
buffer.append_code_point(code_point);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue