xref: /aosp_15_r20/external/curl/tests/data/test1072 (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker<testcase>
2*6236dae4SAndroid Build Coastguard Worker# Authorization is used to force curl to realize that the server is
3*6236dae4SAndroid Build Coastguard Worker# speaking HTTP 1.0. The request is impossible to satisfy with HTTP 1.0
4*6236dae4SAndroid Build Coastguard Worker# because chunked encoding is unavailable, so the request must fail.
5*6236dae4SAndroid Build Coastguard Worker<info>
6*6236dae4SAndroid Build Coastguard Worker<keywords>
7*6236dae4SAndroid Build Coastguard WorkerHTTP
8*6236dae4SAndroid Build Coastguard WorkerHTTP PUT
9*6236dae4SAndroid Build Coastguard WorkerHTTP Digest auth
10*6236dae4SAndroid Build Coastguard Worker--anyauth
11*6236dae4SAndroid Build Coastguard WorkerHTTP/1.0
12*6236dae4SAndroid Build Coastguard Workerchunked Transfer-Encoding
13*6236dae4SAndroid Build Coastguard Worker</keywords>
14*6236dae4SAndroid Build Coastguard Worker</info>
15*6236dae4SAndroid Build Coastguard Worker
16*6236dae4SAndroid Build Coastguard Worker# Server-side
17*6236dae4SAndroid Build Coastguard Worker<reply>
18*6236dae4SAndroid Build Coastguard Worker<data>
19*6236dae4SAndroid Build Coastguard WorkerHTTP/1.0 401 Authorization Required swsclose
20*6236dae4SAndroid Build Coastguard WorkerServer: testcurl
21*6236dae4SAndroid Build Coastguard WorkerWWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
22*6236dae4SAndroid Build Coastguard WorkerWWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
23*6236dae4SAndroid Build Coastguard WorkerWWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
24*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/plain
25*6236dae4SAndroid Build Coastguard WorkerContent-Length: 0
26*6236dae4SAndroid Build Coastguard WorkerConnection: close
27*6236dae4SAndroid Build Coastguard Worker
28*6236dae4SAndroid Build Coastguard Worker</data>
29*6236dae4SAndroid Build Coastguard Worker</reply>
30*6236dae4SAndroid Build Coastguard Worker
31*6236dae4SAndroid Build Coastguard Worker# Client-side
32*6236dae4SAndroid Build Coastguard Worker<client>
33*6236dae4SAndroid Build Coastguard Worker<server>
34*6236dae4SAndroid Build Coastguard Workerhttp
35*6236dae4SAndroid Build Coastguard Worker</server>
36*6236dae4SAndroid Build Coastguard Worker<features>
37*6236dae4SAndroid Build Coastguard Workercrypto
38*6236dae4SAndroid Build Coastguard Worker</features>
39*6236dae4SAndroid Build Coastguard Worker<name>
40*6236dae4SAndroid Build Coastguard WorkerHTTP chunked PUT to HTTP 1.0 server with authorization
41*6236dae4SAndroid Build Coastguard Worker</name>
42*6236dae4SAndroid Build Coastguard Worker<command>
43*6236dae4SAndroid Build Coastguard Workerhttp://%HOSTIP:%HTTPPORT/%TESTNUMBER -T - -u testuser:testpass --anyauth
44*6236dae4SAndroid Build Coastguard Worker</command>
45*6236dae4SAndroid Build Coastguard Worker<stdin>
46*6236dae4SAndroid Build Coastguard WorkerThis is data we upload with PUT
47*6236dae4SAndroid Build Coastguard Workerit comes from stdin so MUST be sent
48*6236dae4SAndroid Build Coastguard Workerwith chunked encoding
49*6236dae4SAndroid Build Coastguard Workerwhich is impossible in HTTP/1.0
50*6236dae4SAndroid Build Coastguard Worker</stdin>
51*6236dae4SAndroid Build Coastguard Worker</client>
52*6236dae4SAndroid Build Coastguard Worker
53*6236dae4SAndroid Build Coastguard Worker# Verify data after the test has been "shot"
54*6236dae4SAndroid Build Coastguard Worker<verify>
55*6236dae4SAndroid Build Coastguard Worker<errorcode>
56*6236dae4SAndroid Build Coastguard Worker25
57*6236dae4SAndroid Build Coastguard Worker</errorcode>
58*6236dae4SAndroid Build Coastguard Worker<protocol>
59*6236dae4SAndroid Build Coastguard WorkerPUT /%TESTNUMBER HTTP/1.1
60*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT
61*6236dae4SAndroid Build Coastguard WorkerUser-Agent: curl/%VERSION
62*6236dae4SAndroid Build Coastguard WorkerAccept: */*
63*6236dae4SAndroid Build Coastguard WorkerTransfer-Encoding: chunked
64*6236dae4SAndroid Build Coastguard WorkerExpect: 100-continue
65*6236dae4SAndroid Build Coastguard Worker
66*6236dae4SAndroid Build Coastguard Worker%if hyper
67*6236dae4SAndroid Build Coastguard Worker7A
68*6236dae4SAndroid Build Coastguard Worker%else
69*6236dae4SAndroid Build Coastguard Worker7a
70*6236dae4SAndroid Build Coastguard Worker%endif
71*6236dae4SAndroid Build Coastguard WorkerThis is data we upload with PUT
72*6236dae4SAndroid Build Coastguard Workerit comes from stdin so MUST be sent
73*6236dae4SAndroid Build Coastguard Workerwith chunked encoding
74*6236dae4SAndroid Build Coastguard Workerwhich is impossible in HTTP/1.0
75*6236dae4SAndroid Build Coastguard Worker
76*6236dae4SAndroid Build Coastguard Worker0
77*6236dae4SAndroid Build Coastguard Worker
78*6236dae4SAndroid Build Coastguard Worker</protocol>
79*6236dae4SAndroid Build Coastguard Worker</verify>
80*6236dae4SAndroid Build Coastguard Worker</testcase>
81