-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Fix crash in Headers::get when handling non-ASCII characters
headers list is ISO-8859-1 encoded using `Infra::isomorphic_encode`, so we should use decode them using `Infra::isomorphic_decode` before return.
- Loading branch information
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Tests/LibWeb/Text/expected/Fetch/fetch-headers-get-nonascii.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
before-æøå-after | ||
before-ß-after |
13 changes: 13 additions & 0 deletions
13
Tests/LibWeb/Text/input/Fetch/fetch-headers-get-nonascii.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<script src="../include.js"></script> | ||
<script> | ||
// This test ensures that the Headers get() methods can handle non-ASCII latin1 characters: code points U+0080-U+00FF. | ||
test(() => { | ||
const headers = new Headers({ | ||
"Accept": "before-æøå-after", | ||
"X-Test": "before-ß-after" | ||
}); | ||
println(headers.get("Accept")); | ||
println(headers.get("X-Test")); | ||
}); | ||
</script> |