Skip to content

HTTP: 0x00 in a header value#21019

Merged
annevk merged 2 commits intomasterfrom
annevk/http-0x00
Jan 3, 2020
Merged

HTTP: 0x00 in a header value#21019
annevk merged 2 commits intomasterfrom
annevk/http-0x00

Conversation

@annevk
Copy link
Copy Markdown
Member

@annevk annevk commented Jan 3, 2020

Tests to complement those written in #10424.

Tests to complement those written in #10424.
async_test(t => {
const img = document.createElement("img");
t.add_cleanup(() => img.remove());
img.src = "resources//blue-with-0x00-in-a-header.asis";
Copy link
Copy Markdown
Contributor

@rwlbuis rwlbuis Jan 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double '/' usage.

def main(request, response):
response.headers.set("Content-Type", "text/html")
response.headers.set("Custom", "\0")
return "<!doctype html><b>This is irrelevant.</b>"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could do a text like "This is a simple document." or something generic.

def main(request, response):
response.headers.set("Content-Type", "text/javascript")
response.headers.set("Custom", "\0")
return "var irrelevant = 0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Copy Markdown
Contributor

@rwlbuis rwlbuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some comments.

@rwlbuis
Copy link
Copy Markdown
Contributor

rwlbuis commented Jan 3, 2020

BTW it seems there are lint errors:
./wpt lint --all
ERROR:lint:fetch/h1-parsing/resources/blue-with-0x00-in-a-header.asis:1: Test-file line ends with CR (U+000D) character (CR AT EOL)
ERROR:lint:fetch/h1-parsing/resources/blue-with-0x00-in-a-header.asis:2: Test-file line ends with CR (U+000D) character (CR AT EOL)
ERROR:lint:fetch/h1-parsing/resources/blue-with-0x00-in-a-header.asis:3: Test-file line ends with CR (U+000D) character (CR AT EOL)
ERROR:lint:fetch/h1-parsing/resources/blue-with-0x00-in-a-header.asis:4: Test-file line ends with CR (U+000D) character (CR AT EOL)
ERROR:lint:fetch/h1-parsing/resources/blue-with-0x00-in-a-header.asis:5: Test-file line ends with CR (U+000D) character (CR AT EOL)

@wpt-pr-bot wpt-pr-bot requested a review from jgraham January 3, 2020 16:01
@annevk annevk merged commit 38ecde8 into master Jan 3, 2020
@annevk annevk deleted the annevk/http-0x00 branch January 3, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants