mirror of
https://github.com/curl/curl.git
synced 2024-12-21 06:50:10 +08:00
a5d994941c
...after the method line: "Since the Host field-value is critical information for handling a request, a user agent SHOULD generate Host as the first header field following the request-line." / RFC 7230 section 5.4 Additionally, this will also make libcurl ignore multiple specified custom Host: headers and only use the first one. Test 1121 has been updated accordingly Bug: http://curl.haxx.se/bug/view.cgi?id=1491 Reported-by: Rainer Canavan
61 lines
992 B
Plaintext
61 lines
992 B
Plaintext
<testcase>
|
|
<info>
|
|
<keywords>
|
|
HTTP
|
|
HTTP POST
|
|
HTTP Basic auth
|
|
</keywords>
|
|
</info>
|
|
#
|
|
# Server-side
|
|
<reply>
|
|
<data>
|
|
HTTP/1.0 200 OK
|
|
Server: test-server/fake
|
|
Content-Type: text/html
|
|
Content-Length: 0
|
|
|
|
this is data even though Content-Length is set to zero
|
|
</data>
|
|
<datacheck>
|
|
HTTP/1.0 200 OK
|
|
Server: test-server/fake
|
|
Content-Type: text/html
|
|
Content-Length: 0
|
|
|
|
</datacheck>
|
|
</reply>
|
|
|
|
#
|
|
# Client-side
|
|
<client>
|
|
<server>
|
|
http
|
|
</server>
|
|
<name>
|
|
HTTP POST with auth and contents but with content-length set to 0
|
|
</name>
|
|
<command>
|
|
-d "fooo=mooo&pooo=clue&doo=%20%20%20++++" -u "fake:-user" http://%HOSTIP:%HTTPPORT/3
|
|
</command>
|
|
</client>
|
|
|
|
#
|
|
# Verify data after the test has been "shot"
|
|
<verify>
|
|
<strip>
|
|
^User-Agent:.*
|
|
</strip>
|
|
<protocol nonewline="yes">
|
|
POST /3 HTTP/1.1
|
|
Host: %HOSTIP:%HTTPPORT
|
|
Authorization: Basic ZmFrZTotdXNlcg==
|
|
Accept: */*
|
|
Content-Length: 37
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
fooo=mooo&pooo=clue&doo=%20%20%20++++
|
|
</protocol>
|
|
</verify>
|
|
</testcase>
|