Imported Upstream version 7.48.0
[platform/upstream/curl.git] / tests / data / test1075
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP PUT
6 HTTP Basic auth
7 --anyauth
8 </keywords>
9 </info>
10
11 # Server-side
12 <reply>
13 # The test server provides no way to respond differently to a subsequent
14 # Basic authenticated request (we really want to respond with 200 for
15 # the second), so just respond with 401 for both and let curl deal with it.
16 <data>
17 HTTP/1.1 401 Authorization Required\r
18 Server: testcurl\r
19 WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"\r
20 WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"\r
21 WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"\r
22 Content-Type: text/plain\r
23 Content-Length: 0\r
24 \r
25 </data>
26 <datacheck>
27 HTTP/1.1 401 Authorization Required\r
28 Server: testcurl\r
29 WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"\r
30 WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"\r
31 WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"\r
32 Content-Type: text/plain\r
33 Content-Length: 0\r
34 \r
35 HTTP/1.1 401 Authorization Required\r
36 Server: testcurl\r
37 WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"\r
38 WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"\r
39 WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"\r
40 Content-Type: text/plain\r
41 Content-Length: 0\r
42 \r
43 </datacheck>
44 </reply>
45
46 # Client-side
47 <client>
48 <server>
49 http
50 </server>
51  <name>
52 HTTP PUT with --anyauth authorization (picking Basic)
53  </name>
54  <command>
55 http://%HOSTIP:%HTTPPORT/1075 -T log/put1075 -u testuser:testpass --anyauth
56 </command>
57 <file name="log/put1075">
58 This is data we upload with PUT
59 a second line
60 line three
61 four is the number of lines
62 </file>
63 </client>
64
65 # Verify data after the test has been "shot"
66 <verify>
67 <strip>
68 ^User-Agent:.*
69 </strip>
70 <protocol>
71 PUT /1075 HTTP/1.1\r
72 Host: %HOSTIP:%HTTPPORT\r
73 Accept: */*\r
74 Content-Length: 85\r
75 Expect: 100-continue\r
76 \r
77 This is data we upload with PUT
78 a second line
79 line three
80 four is the number of lines
81 PUT /1075 HTTP/1.1\r
82 Host: %HOSTIP:%HTTPPORT\r
83 Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=\r
84 Accept: */*\r
85 Content-Length: 85\r
86 Expect: 100-continue\r
87 \r
88 This is data we upload with PUT
89 a second line
90 line three
91 four is the number of lines
92 </protocol>
93 </verify>
94 </testcase>