diff options
author | Linos Giannopoulos <lgian@skroutz.gr> | 2019-07-10 14:11:57 +0300 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-07-14 16:30:28 +0200 |
commit | 797e549d0d6009b60786ac82465df26e1fc52ac6 (patch) | |
tree | b8eacedc66cfeb3eaebf5a1ed731e3e2abc4e41b /tests/data/test1563 | |
parent | 6080ea098d97393da32c6f66eb95c7144620298c (diff) | |
download | curl-797e549d0d6009b60786ac82465df26e1fc52ac6.tar.gz |
libcurl: Add testcase for gopher redirects
The testcase ensures that redirects to CURLPROTO_GOPHER won't be
allowed, by default, in the future. Also, curl is being used
for convenience while keeping the testcases DRY.
The expected error code is CURLE_UNSUPPORTED_PROTOCOL when the client is
redirected to CURLPROTO_GOPHER
Signed-off-by: Linos Giannopoulos <lgian@skroutz.gr>
Diffstat (limited to 'tests/data/test1563')
-rw-r--r-- | tests/data/test1563 | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/data/test1563 b/tests/data/test1563 new file mode 100644 index 000000000..a3597b9b5 --- /dev/null +++ b/tests/data/test1563 @@ -0,0 +1,51 @@ +<testcase> +<info> +<keywords> +GOPHER +HTTP GET +followlocation +</keywords> +</info> + +# Server-side +<reply> +<data1> +HTTP/1.1 302 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Content-Length: 7 +Location: gopher://www.example.co.uk + +nomnom +</data1> +</reply> + +# Client-side +<client> +<server> +http +</server> +<name> +Make sure redirects to CURLPROTO_GOPHER are forbidden by default +</name> +<command> +http://%HOSTIP:%HTTPPORT/15630001 -L -H "Host: www.example.com" +</command> +</client> +<verify> +<strip> +^User-Agent:.* +</strip> +<errorcode> +1 +</errorcode> +<protocol> +GET /15630001 HTTP/1.1
+Host: www.example.com
+Accept: */*
+
+</protocol> + +</verify> + +</testcase> |