1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-04 08:35:05 -05:00
curl/tests/data/test1418
Daniel Stenberg a5d994941c http: always send Host: header as first header
...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
2015-03-12 12:15:24 +01:00

109 lines
2.0 KiB
Plaintext

<testcase>
<info>
<keywords>
HTTP
HTTP GET
HTTP NTLM auth
connection re-use
</keywords>
</info>
# Server-side
<reply>
<servercmd>
connection-monitor
</servercmd>
<data>
HTTP/1.1 401 Authentication please!
Content-Length: 20
WWW-Authenticate: Digest realm="loonie", nonce="314156592"
WWW-Authenticate: Basic
Please auth with me
</data>
# This is supposed to be returned when the server gets the second
# Authorization: NTLM line passed-in from the client
<data1000>
HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Length: 4
moo
</data1000>
<data1003>
HTTP/1.1 200 OK
Server: Another one/1.0
Content-Length: 4
boo
</data1003>
# This is the first reply after the redirection
<data1011>
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Content-Type: text/html; charset=iso-8859-1
Content-Length: 34
This is not the real page either!
</data1011>
<datacheck>
HTTP/1.1 401 Authentication please!
Content-Length: 20
WWW-Authenticate: Digest realm="loonie", nonce="314156592"
WWW-Authenticate: Basic
HTTP/1.1 200 Things are fine in server land
Server: Microsoft-IIS/5.0
Content-Length: 4
moo
</datacheck>
</reply>
# Client-side
<client>
<server>
http
</server>
<features>
!SSPI
crypto
</features>
<name>
HTTP with --anyauth and connection re-use
</name>
<command>
http://%HOSTIP:%HTTPPORT/1418 -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/14180003
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<strip>
^User-Agent:.*
</strip>
<protocol>
GET /1418 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Accept: */*
GET /1418 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/1418", response="986238b7e0077754944c966f56d9bc77"
Accept: */*
GET /14180003 HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Digest username="testuser", realm="loonie", nonce="314156592", uri="/14180003", response="1c6390a67bac3283a9b023402f3b3540"
Accept: */*
[DISCONNECT]
</protocol>
</verify>
</testcase>