Skip to content

Commit

Permalink
LibWeb: Add test for non-ascii content-type headers
Browse files Browse the repository at this point in the history
This couldn't be added in #1893
  • Loading branch information
Gingeh authored and tcl3 committed Dec 6, 2024
1 parent ebc9168 commit e4512d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tests/LibWeb/Text/expected/http-non-ascii-content-type.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PASS (didn't crash)
22 changes: 22 additions & 0 deletions Tests/LibWeb/Text/input/http-non-ascii-content-type.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<script src="include.js"></script>
<script>
asyncTest(async (done) => {
try {
const httpServer = httpTestServer();
const url = await httpServer.createEcho("GET", "/http-non-ascii-content-type-test", {
status: 200,
headers: {
"Access-Control-Allow-Origin": "*",
"Content-Type": "text/html;test=ÿ;charset=gbk",
},
});

const blob = await fetch(url).then((response) => response.blob());
println("PASS (didn't crash)");
} catch (err) {
println("FAIL - " + err);
}
done();
});
</script>

0 comments on commit e4512d8

Please sign in to comment.