summaryrefslogtreecommitdiff
path: root/tests/data/test1075
blob: 2d111f284153e9c9a74df20f210ae672729a8aef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<testcase>
<info>
<keywords>
HTTP
HTTP PUT
HTTP Basic auth
--anyauth
</keywords>
</info>

# Server-side
<reply>
# The test server provides no way to respond differently to a subsequent
# Basic authenticated request (we really want to respond with 200 for
# the second), so just respond with 401 for both and let curl deal with it.
<data>
HTTP/1.1 401 Authorization Required
Server: testcurl
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
Content-Type: text/plain
Content-Length: 0

</data>
<datacheck>
HTTP/1.1 401 Authorization Required
Server: testcurl
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
Content-Type: text/plain
Content-Length: 0

HTTP/1.1 401 Authorization Required
Server: testcurl
WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
Content-Type: text/plain
Content-Length: 0

</datacheck>
</reply>

# Client-side
<client>
<server>
http
</server>
 <name>
HTTP PUT with --anyauth authorization (picking Basic)
 </name>
 <command>
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T log/put%TESTNUMBER -u testuser:testpass --anyauth
</command>
<file name="log/put%TESTNUMBER">
This is data we upload with PUT
a second line
line three
four is the number of lines
</file>
</client>

# Verify data after the test has been "shot"
<verify>
<protocol>
PUT /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
Content-Length: 85
Expect: 100-continue

This is data we upload with PUT
a second line
line three
four is the number of lines
PUT /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
User-Agent: curl/%VERSION
Accept: */*
Content-Length: 85
Expect: 100-continue

This is data we upload with PUT
a second line
line three
four is the number of lines
</protocol>
</verify>
</testcase>