mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Whitespace and null in header values</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src=support.js?pipe=sub></script>
|
||||
|
||||
<h1>Whitespace and null in response header values</h1>
|
||||
|
||||
<div id=log></div>
|
||||
|
||||
<script>
|
||||
|
||||
function matchHeaderValue(val) {
|
||||
test(function () {
|
||||
var client = new XMLHttpRequest();
|
||||
var trimmed = val.trim();
|
||||
client.open("GET", "resources/parse-headers.py?my-custom-header="+encodeURIComponent(val), false);
|
||||
client.send();
|
||||
var r = client.getResponseHeader("My-Custom-Header");
|
||||
|
||||
assert_equals(r, trimmed);
|
||||
}, "Header value: " + val.replace(/\t/g, "[tab]").replace(/ /g, "_").replace("\0", "\\0"));
|
||||
}
|
||||
|
||||
matchHeaderValue("hello world\0");
|
||||
matchHeaderValue("\0hello world");
|
||||
matchHeaderValue("hello\0world");
|
||||
matchHeaderValue(" hello world");
|
||||
matchHeaderValue("hello world ");
|
||||
matchHeaderValue(" hello world ");
|
||||
matchHeaderValue("\thello world");
|
||||
matchHeaderValue("hello world\t");
|
||||
matchHeaderValue("\thello world\t");
|
||||
matchHeaderValue("hello world");
|
||||
matchHeaderValue("hello\tworld");
|
||||
matchHeaderValue("\0");
|
||||
matchHeaderValue(" ");
|
||||
matchHeaderValue("\t");
|
||||
matchHeaderValue("");
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue