xref: /aosp_15_r20/external/curl/tests/data/test1051 (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker<testcase>
2*6236dae4SAndroid Build Coastguard Worker<info>
3*6236dae4SAndroid Build Coastguard Worker<keywords>
4*6236dae4SAndroid Build Coastguard WorkerHTTP
5*6236dae4SAndroid Build Coastguard WorkerHTTP PUT
6*6236dae4SAndroid Build Coastguard Workerfollowlocation
7*6236dae4SAndroid Build Coastguard Worker</keywords>
8*6236dae4SAndroid Build Coastguard Worker
9*6236dae4SAndroid Build Coastguard Worker</info>
10*6236dae4SAndroid Build Coastguard Worker# Server-side
11*6236dae4SAndroid Build Coastguard Worker<reply>
12*6236dae4SAndroid Build Coastguard Worker<data>
13*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 301 Redirect swsclose
14*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
15*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
16*6236dae4SAndroid Build Coastguard WorkerLocation: data/%TESTNUMBER0002.txt?coolsite=yes
17*6236dae4SAndroid Build Coastguard WorkerContent-Length: 0
18*6236dae4SAndroid Build Coastguard WorkerConnection: close
19*6236dae4SAndroid Build Coastguard Worker
20*6236dae4SAndroid Build Coastguard Worker</data>
21*6236dae4SAndroid Build Coastguard Worker<data2>
22*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 100 Continue
23*6236dae4SAndroid Build Coastguard Worker
24*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 200 Followed here fine swsclose
25*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
26*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
27*6236dae4SAndroid Build Coastguard WorkerContent-Length: 51
28*6236dae4SAndroid Build Coastguard Worker
29*6236dae4SAndroid Build Coastguard WorkerIf this is received, the location following worked
30*6236dae4SAndroid Build Coastguard Worker</data2>
31*6236dae4SAndroid Build Coastguard Worker<datacheck>
32*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 301 Redirect swsclose
33*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
34*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
35*6236dae4SAndroid Build Coastguard WorkerLocation: data/%TESTNUMBER0002.txt?coolsite=yes
36*6236dae4SAndroid Build Coastguard WorkerContent-Length: 0
37*6236dae4SAndroid Build Coastguard WorkerConnection: close
38*6236dae4SAndroid Build Coastguard Worker
39*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 100 Continue
40*6236dae4SAndroid Build Coastguard Worker
41*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 200 Followed here fine swsclose
42*6236dae4SAndroid Build Coastguard WorkerDate: Thu, 29 Jul 2008 14:49:00 GMT
43*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake
44*6236dae4SAndroid Build Coastguard WorkerContent-Length: 51
45*6236dae4SAndroid Build Coastguard Worker
46*6236dae4SAndroid Build Coastguard WorkerIf this is received, the location following worked
47*6236dae4SAndroid Build Coastguard Worker</datacheck>
48*6236dae4SAndroid Build Coastguard Worker</reply>
49*6236dae4SAndroid Build Coastguard Worker
50*6236dae4SAndroid Build Coastguard Worker# Client-side
51*6236dae4SAndroid Build Coastguard Worker<client>
52*6236dae4SAndroid Build Coastguard Worker<server>
53*6236dae4SAndroid Build Coastguard Workerhttp
54*6236dae4SAndroid Build Coastguard Worker</server>
55*6236dae4SAndroid Build Coastguard Worker<name>
56*6236dae4SAndroid Build Coastguard WorkerHTTP PUT with Location: following
57*6236dae4SAndroid Build Coastguard Worker</name>
58*6236dae4SAndroid Build Coastguard Worker<command>
59*6236dae4SAndroid Build Coastguard Workerhttp://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -L -T %LOGDIR/test%TESTNUMBER.txt
60*6236dae4SAndroid Build Coastguard Worker</command>
61*6236dae4SAndroid Build Coastguard Worker<file name="%LOGDIR/test%TESTNUMBER.txt">
62*6236dae4SAndroid Build Coastguard WorkerWeird
63*6236dae4SAndroid Build Coastguard Worker     file
64*6236dae4SAndroid Build Coastguard Worker         to
65*6236dae4SAndroid Build Coastguard Worker   upload
66*6236dae4SAndroid Build Coastguard Workerfor
67*6236dae4SAndroid Build Coastguard Worker   testing
68*6236dae4SAndroid Build Coastguard Workerthe
69*6236dae4SAndroid Build Coastguard Worker   PUT
70*6236dae4SAndroid Build Coastguard Worker      feature
71*6236dae4SAndroid Build Coastguard Worker</file>
72*6236dae4SAndroid Build Coastguard Worker</client>
73*6236dae4SAndroid Build Coastguard Worker
74*6236dae4SAndroid Build Coastguard Worker# Verify data after the test has been "shot"
75*6236dae4SAndroid Build Coastguard Worker<verify>
76*6236dae4SAndroid Build Coastguard Worker
77*6236dae4SAndroid Build Coastguard Worker# The primary reason libcurl sends the data part twice in this test is that
78*6236dae4SAndroid Build Coastguard Worker# the test HTTP server is blocking until it has read the entire request,
79*6236dae4SAndroid Build Coastguard Worker# including the full request-body before it responds. So in this test the
80*6236dae4SAndroid Build Coastguard Worker# server says 301 and 100 _after_ the entire PUT body has been sent.
81*6236dae4SAndroid Build Coastguard Worker
82*6236dae4SAndroid Build Coastguard Worker<protocol>
83*6236dae4SAndroid Build Coastguard WorkerPUT /want/%TESTNUMBER HTTP/1.1
84*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT
85*6236dae4SAndroid Build Coastguard WorkerUser-Agent: curl/%VERSION
86*6236dae4SAndroid Build Coastguard WorkerAccept: */*
87*6236dae4SAndroid Build Coastguard WorkerContent-Length: 78
88*6236dae4SAndroid Build Coastguard Worker
89*6236dae4SAndroid Build Coastguard WorkerWeird
90*6236dae4SAndroid Build Coastguard Worker     file
91*6236dae4SAndroid Build Coastguard Worker         to
92*6236dae4SAndroid Build Coastguard Worker   upload
93*6236dae4SAndroid Build Coastguard Workerfor
94*6236dae4SAndroid Build Coastguard Worker   testing
95*6236dae4SAndroid Build Coastguard Workerthe
96*6236dae4SAndroid Build Coastguard Worker   PUT
97*6236dae4SAndroid Build Coastguard Worker      feature
98*6236dae4SAndroid Build Coastguard WorkerPUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.1
99*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT
100*6236dae4SAndroid Build Coastguard WorkerUser-Agent: curl/%VERSION
101*6236dae4SAndroid Build Coastguard WorkerAccept: */*
102*6236dae4SAndroid Build Coastguard WorkerContent-Length: 78
103*6236dae4SAndroid Build Coastguard Worker
104*6236dae4SAndroid Build Coastguard WorkerWeird
105*6236dae4SAndroid Build Coastguard Worker     file
106*6236dae4SAndroid Build Coastguard Worker         to
107*6236dae4SAndroid Build Coastguard Worker   upload
108*6236dae4SAndroid Build Coastguard Workerfor
109*6236dae4SAndroid Build Coastguard Worker   testing
110*6236dae4SAndroid Build Coastguard Workerthe
111*6236dae4SAndroid Build Coastguard Worker   PUT
112*6236dae4SAndroid Build Coastguard Worker      feature
113*6236dae4SAndroid Build Coastguard Worker</protocol>
114*6236dae4SAndroid Build Coastguard Worker</verify>
115*6236dae4SAndroid Build Coastguard Worker</testcase>
116