]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: fix some http/2 tests for older versions of nghttpx
authorJay Satiro <raysatiro@yahoo.com>
Thu, 29 Oct 2020 04:06:27 +0000 (00:06 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 30 Oct 2020 03:08:03 +0000 (23:08 -0400)
- Add regex that strips http/2 server header name to those http/2 tests
  that don't already have it.

- Improve that regex in all http/2 tests.

Tests 358 and 359 were failing for me before this change on a system
that uses an older version of nghttpx which includes its version number
in the server header.

Closes https://github.com/curl/curl/pull/6139

tests/data/test1700
tests/data/test1701
tests/data/test1702
tests/data/test358
tests/data/test359

index ff1e2724f07eb54d09bc680edb0b1ec998a3857f..39260bc898c509c9e4f50637d0078247a5de713a 100644 (file)
@@ -82,7 +82,6 @@ accept-ranges: bytes
 content-length: 6\r
 content-type: text/html\r
 funny-head: yesyes\r
-server: cut-out\r
 via: 1.1 nghttpx\r
 \r
 -foo-
@@ -90,13 +89,12 @@ HTTP/2 200
 date: Thu, 09 Nov 2010 14:49:00 GMT\r
 content-length: 6\r
 content-type: text/html\r
-server: cut-out\r
 via: 1.1 nghttpx\r
 \r
 -maa-
 </stdout>
 <stripfile>
-s/^server:.*/server: cut-out\r/
+s/^server: nghttpx.*\r?\n//
 </stripfile>
 </verify>
 </testcase>
index d8986173419ac22e32b275a5a643ca1b6b29088a..26da95f3445de331a2abdcc5013d659b47f35087 100644 (file)
@@ -71,13 +71,12 @@ accept-ranges: bytes
 content-length: 6\r
 content-type: text/html\r
 funny-head: yesyes\r
-server: cut-out\r
 via: 1.1 nghttpx\r
 \r
 -foo-
 </stdout>
 <stripfile>
-s/^server:.*/server: cut-out\r/
+s/^server: nghttpx.*\r?\n//
 </stripfile>
 </verify>
 </testcase>
index 15757674dc78a089c74667ad51f48fee34bc5c7e..bbb9084e2d4ab9ff18799fc49a5f02cf698d92d5 100644 (file)
@@ -67,12 +67,11 @@ accept-ranges: bytes
 content-length: 6\r
 content-type: text/html\r
 funny-head: yesyes\r
-server: cut-out\r
 via: 1.1 nghttpx\r
 \r
 </stdout>
 <stripfile>
-s/^server:.*/server: cut-out\r/
+s/^server: nghttpx.*\r?\n//
 </stripfile>
 </verify>
 </testcase>
index 82ff8adf7ad56aed0720898edea6cdd9da70fe0b..3ea88da86f87da89583db1e5902a63021b8de4e3 100644 (file)
@@ -65,7 +65,6 @@ content-length: 6
 content-type: text/html\r
 funny-head: yesyes\r
 alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0\r
-server: nghttpx\r
 via: 1.1 nghttpx\r
 \r
 -foo-
@@ -75,12 +74,12 @@ content-length: 6
 content-type: text/html\r
 funny-head: yesyes\r
 alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0\r
-server: nghttpx\r
 via: 1.1 nghttpx\r
 \r
 -foo-
 </stdout>
 <stripfile>
+s/^server: nghttpx.*\r?\n//
 # strip out the (dynamic) expire date from the file so that the rest
 # matches
 s/\"2([^\"]*)\"/TIMESTAMP/
index c0faee21dcd19bb08a57c2a31819f251a940f182..0481899bb2b5c6b76c0d4fa69623867dbc6bd149 100644 (file)
@@ -65,7 +65,6 @@ content-length: 6
 content-type: text/html\r
 funny-head: yesyes\r
 alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0\r
-server: nghttpx\r
 via: 1.1 nghttpx\r
 \r
 -foo-
@@ -75,12 +74,12 @@ content-length: 6
 content-type: text/html\r
 funny-head: yesyes\r
 alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0\r
-server: nghttpx\r
 via: 1.1 nghttpx\r
 \r
 -foo-
 </stdout>
 <stripfile>
+s/^server: nghttpx.*\r?\n//
 # strip out the (dynamic) expire date from the file so that the rest
 # matches
 s/\"2([^\"]*)\"/TIMESTAMP/