]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test493: verify --hsts upgrade and that %{url_effective} reflects that
authorDaniel Stenberg <daniel@haxx.se>
Thu, 5 Nov 2020 08:19:23 +0000 (09:19 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 6 Nov 2020 07:22:34 +0000 (08:22 +0100)
Closes #6175

tests/data/Makefile.inc
tests/data/test493 [new file with mode: 0644]

index 8b7847e9606065f1e8f2091ad80caf4d77278f33..b9d03bce278a3f40247755620d085344734840ae 100644 (file)
@@ -68,7 +68,7 @@ test409 \
 \
 test430 test431 test432 test433 test434 \
 \
-test490 test491 test492 \
+test490 test491 test492 test493 \
 \
 test500 test501 test502 test503 test504 test505 test506 test507 test508 \
 test509 test510 test511 test512 test513 test514 test515 test516 test517 \
diff --git a/tests/data/test493 b/tests/data/test493
new file mode 100644 (file)
index 0000000..f7758da
--- /dev/null
@@ -0,0 +1,61 @@
+<testcase>
+<info>
+<keywords>
+HSTS
+url_effective
+</keywords>
+</info>
+
+<reply>
+
+# we use this as response to a CONNECT
+<data nocheck="yes">
+HTTP/1.1 403 not OK at all
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Content-Length: 6
+Connection: close
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+<client>
+<server>
+http
+</server>
+<features>
+HSTS
+</features>
+
+<file name="log/input493">
+.hsts.example "20311001 04:47:41"
+</file>
+
+<name>
+HSTS and %{url_effective} after upgrade
+</name>
+<command>
+-x http://%HOSTIP:%HTTPPORT http://this.hsts.example/493 --hsts log/input493 -w '%{url_effective}\n'
+</command>
+</client>
+
+<verify>
+# we let it CONNECT to the server to confirm HSTS but deny from there
+<protocol>
+CONNECT this.hsts.example:443 HTTP/1.1\r
+Host: this.hsts.example:443\r
+User-Agent: curl/%VERSION\r
+Proxy-Connection: Keep-Alive\r
+\r
+</protocol>
+<stdout>
+https://this.hsts.example/493
+</stdout>
+# Proxy CONNECT aborted
+<errorcode>
+56
+</errorcode>
+</verify>
+</testcase>