Skip to content

Commit c656bfa

Browse files
committed
add repro for invalid header char
1 parent 639ba32 commit c656bfa

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

packages/server/test/e2e/6_visit_spec.coffee

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ onServer = (app) ->
4646
## dont ever end this response
4747
res.type("html").write("foo\n")
4848

49+
## https://github.com/cypress-io/cypress/issues/5602
50+
app.get "/invalid-header-char", (req, res) ->
51+
## express/node may interfere if we just use res.setHeader
52+
res.connection.write(
53+
"""
54+
HTTP/1.1 200 OK
55+
Content-Type: text/html
56+
X-Foo: #{String.fromCharCode(0)}
57+
58+
foo
59+
"""
60+
)
61+
62+
res.connection.end()
63+
4964
describe "e2e visit", ->
5065
require("mocha-banner").register()
5166

packages/server/test/support/fixtures/projects/e2e/cypress/integration/visit_spec.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ describe "visits", ->
1010
it "can load a local file with a huge amount of elements without timing out", ->
1111
cy.visit("/elements.html", {timeout: 5000})
1212

13+
## https://github.com/cypress-io/cypress/issues/5602
14+
it.only "can load a website which uses invalid HTTP header chars", ->
15+
cy.visit("http://localhost:3434/invalid-header-char")
16+
.contains('foo')
17+
1318
context "issue #225: hash urls", ->
1419
rand = Math.random()
1520

0 commit comments

Comments
 (0)