Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP: 0x00 in a header value #21019

Merged
merged 2 commits into from
Jan 3, 2020
Merged

HTTP: 0x00 in a header value #21019

merged 2 commits into from
Jan 3, 2020

Conversation

annevk
Copy link
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
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
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
Contributor

Choose a reason for hiding this comment

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

Ditto.

Copy link
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
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