mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:43:34 +03:00
proxy: chunked response, error code
Add test1715 to check proper handling of chunked transfer encoding in CONNECT responses. Change proxy error code from 56 (RECV_ERROR) for everything to 7 (COULDNT_CONNECT) when the server response could be read successfully, but establishing the connection is not possible (http status code wrong). Adapt several test expectations from 56 to 7. Closes #21084
This commit is contained in:
parent
39036c9021
commit
a186ecf4bf
15 changed files with 84 additions and 29 deletions
|
|
@ -229,7 +229,7 @@ test1670 test1671 test1672 test1673 \
|
|||
test1680 test1681 test1682 test1683 test1684 \
|
||||
\
|
||||
test1700 test1701 test1702 test1703 test1704 test1705 test1706 test1707 \
|
||||
test1708 test1709 test1710 test1711 test1712 test1713 test1714 \
|
||||
test1708 test1709 test1710 test1711 test1712 test1713 test1714 test1715 \
|
||||
\
|
||||
test1800 test1801 test1802 test1847 test1848 test1849 test1850 test1851 \
|
||||
\
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ ftp://test-number:%TESTNUMBER/wanted/page -p -x %HOSTIP:%HTTPPORT
|
|||
<verify>
|
||||
# The server does not implement CONNECT for ftp, so this must be a failure test
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
<protocol crlf="headers">
|
||||
CONNECT test-number:%TESTNUMBER HTTP/1.1
|
||||
|
|
|
|||
54
tests/data/test1715
Normal file
54
tests/data/test1715
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP GET
|
||||
HTTP CONNECT
|
||||
HTTP proxy
|
||||
proxytunnel
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
<reply>
|
||||
|
||||
<connect crlf="headers">
|
||||
HTTP/1.1 407 Proxy Authentication Required
|
||||
Proxy-Authenticate: Special realm="none", nonce="abc123"
|
||||
Content-Length: 13
|
||||
Transfer-Encoding: chunked
|
||||
Magic-special: true
|
||||
|
||||
some content
|
||||
</connect>
|
||||
</reply>
|
||||
|
||||
<client>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<features>
|
||||
proxy
|
||||
</features>
|
||||
<name>
|
||||
HTTP CONNECT with proxy returning Content-Length and chunked
|
||||
</name>
|
||||
<command>
|
||||
http://test.example --proxy http://%HOSTIP:%HTTPPORT --proxytunnel -sS
|
||||
</command>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol crlf="headers">
|
||||
CONNECT test.example:80 HTTP/1.1
|
||||
Host: test.example:80
|
||||
User-Agent: curl/%VERSION
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</protocol>
|
||||
<errorcode>
|
||||
56
|
||||
</errorcode>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
@ -49,9 +49,9 @@ User-Agent: curl/%VERSION
|
|||
Proxy-Connection: Keep-Alive
|
||||
|
||||
</protocol>
|
||||
# CURLE_RECV_ERROR
|
||||
# CURLE_COULDNT_CONNECT
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
<stdout crlf="headers">
|
||||
HTTP/1.1 405 Method Not Allowed swsclose
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ Proxy-Connection: Keep-Alive
|
|||
User-Agent: looser/2007
|
||||
|
||||
</protocol>
|
||||
# CURLE_RECV_ERROR
|
||||
# CURLE_COULDNT_CONNECT
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
<stdout crlf="headers">
|
||||
HTTP/1.1 405 Method Not Allowed swsclose
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ HTTPS GET over HTTP proxy fails
|
|||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
<data>
|
||||
</data>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ https://this.hsts.example./%TESTNUMBER
|
|||
</stdout>
|
||||
# Proxy CONNECT aborted
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
<limits>
|
||||
Allocations: 160
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ https://this.hsts.example/%TESTNUMBER
|
|||
</stdout>
|
||||
# Proxy CONNECT aborted
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ https://this.hsts.example/%TESTNUMBER
|
|||
</stdout>
|
||||
# Proxy CONNECT aborted
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ Proxy-Connection: Keep-Alive
|
|||
|
||||
</protocol>
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ Proxy-Connection: Keep-Alive
|
|||
|
||||
</protocol>
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
<stderr mode="text">
|
||||
curl: (56) CONNECT tunnel failed, response 400
|
||||
curl: (7) CONNECT tunnel failed, response 400
|
||||
</stderr>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ https://test.anything.really.com:%TESTNUMBER --proxy1.0 %HOSTIP:%HTTPPORT
|
|||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
56
|
||||
7
|
||||
</errorcode>
|
||||
<protocol crlf="headers">
|
||||
CONNECT test.anything.really.com:%TESTNUMBER HTTP/1.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue