• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP PUT
6HTTP 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>
17HTTP/1.1 401 Authorization Required
18Server: testcurl
19WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
20WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
21WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
22Content-Type: text/plain
23Content-Length: 0
24
25</data>
26<datacheck>
27HTTP/1.1 401 Authorization Required
28Server: testcurl
29WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
30WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
31WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
32Content-Type: text/plain
33Content-Length: 0
34
35HTTP/1.1 401 Authorization Required
36Server: testcurl
37WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
38WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
39WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
40Content-Type: text/plain
41Content-Length: 0
42
43</datacheck>
44</reply>
45
46# Client-side
47<client>
48<server>
49http
50</server>
51 <name>
52HTTP PUT with --anyauth authorization (picking Basic)
53 </name>
54 <command>
55http://%HOSTIP:%HTTPPORT/1075 -T log/put1075 -u testuser:testpass --anyauth
56</command>
57<file name="log/put1075">
58This is data we upload with PUT
59a second line
60line three
61four is the number of lines
62</file>
63</client>
64
65# Verify data after the test has been "shot"
66<verify>
67<protocol>
68PUT /1075 HTTP/1.1
69Host: %HOSTIP:%HTTPPORT
70User-Agent: curl/%VERSION
71Accept: */*
72Content-Length: 85
73Expect: 100-continue
74
75This is data we upload with PUT
76a second line
77line three
78four is the number of lines
79PUT /1075 HTTP/1.1
80Host: %HOSTIP:%HTTPPORT
81Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
82User-Agent: curl/%VERSION
83Accept: */*
84Content-Length: 85
85Expect: 100-continue
86
87This is data we upload with PUT
88a second line
89line three
90four is the number of lines
91</protocol>
92</verify>
93</testcase>
94