summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-02-11 16:30:32 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-02-12 08:13:37 +0100
commit88dd1a8a115b1f5ece26fd8941b4464973b7d913 (patch)
tree2dff281d92e8795a15520ef3568fb55ec7a32fbc /tests
parentbd6b54ba1f55b579b7fc90de271bb1992a8fb975 (diff)
downloadcurl-88dd1a8a115b1f5ece26fd8941b4464973b7d913.tar.gz
urldata: don't touch data->set.httpversion at run-time
Rename it to 'httpwant' and make a cloned field in the state struct as well for run-time updates. Also: refuse non-supported HTTP versions. Verified with test 129. Closes #6585
Diffstat (limited to 'tests')
-rw-r--r--tests/data/Makefile.inc2
-rw-r--r--tests/data/test12957
2 files changed, 58 insertions, 1 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index e162abba9..0b0e90d3e 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -34,7 +34,7 @@ test90 test91 test92 test93 test94 test95 test96 test97 test98 test99 \
test100 test101 test102 test103 test104 test105 test106 test107 test108 \
test109 test110 test111 test112 test113 test114 test115 test116 test117 \
test118 test119 test120 test121 test122 test123 test124 test125 test126 \
-test127 test128 test130 test131 test132 test133 test134 test135 \
+test127 test128 test129 test130 test131 test132 test133 test134 test135 \
test136 test137 test138 test139 test140 test141 test142 test143 test144 \
test145 test146 test147 test148 test149 test150 test151 test152 test153 \
test154 test155 test156 test157 test158 test159 test160 test161 test162 \
diff --git a/tests/data/test129 b/tests/data/test129
new file mode 100644
index 000000000..6fe4ad9c5
--- /dev/null
+++ b/tests/data/test129
@@ -0,0 +1,57 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.2 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+ <name>
+HTTP/1.2 is rejected
+ </name>
+ <command>
+http://%HOSTIP:%HTTPPORT/129
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /129 HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+# CURLE_UNSUPPORTED_PROTOCOL
+<errorcode>
+1
+</errorcode>
+</verify>
+</testcase>