xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP PUT |
| 6 | followlocation |
| 7 | </keywords> |
| 8 | |
| 9 | </info> |
| 10 | # Server-side |
| 11 | <reply> |
| 12 | <data> |
| 13 | HTTP/1.0 301 Redirect swsclose
|
| 14 | Date: Thu, 29 Jul 2008 14:49:00 GMT
|
| 15 | Server: test-server/fake
|
| 16 | Location: data/%TESTNUMBER0002.txt?coolsite=yes
|
| 17 | Content-Length: 0
|
| 18 | Connection: close
|
| 19 |
|
| 20 | </data> |
| 21 | <data2> |
| 22 | HTTP/1.0 200 Followed here fine swsclose
|
| 23 | Date: Thu, 29 Jul 2008 14:49:00 GMT
|
| 24 | Server: test-server/fake
|
| 25 | Content-Length: 51
|
| 26 |
|
| 27 | If this is received, the location following worked |
| 28 | </data2> |
| 29 | <datacheck> |
| 30 | HTTP/1.0 301 Redirect swsclose
|
| 31 | Date: Thu, 29 Jul 2008 14:49:00 GMT
|
| 32 | Server: test-server/fake
|
| 33 | Location: data/%TESTNUMBER0002.txt?coolsite=yes
|
| 34 | Content-Length: 0
|
| 35 | Connection: close
|
| 36 |
|
| 37 | HTTP/1.0 200 Followed here fine swsclose
|
| 38 | Date: Thu, 29 Jul 2008 14:49:00 GMT
|
| 39 | Server: test-server/fake
|
| 40 | Content-Length: 51
|
| 41 |
|
| 42 | If this is received, the location following worked |
| 43 | </datacheck> |
| 44 | </reply> |
| 45 | |
| 46 | # Client-side |
| 47 | <client> |
| 48 | <server> |
| 49 | http |
| 50 | </server> |
| 51 | <name> |
| 52 | HTTP 1.0 PUT with Location: following |
| 53 | </name> |
| 54 | <command> |
| 55 | http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -0 -L -T log/test%TESTNUMBER.txt |
| 56 | </command> |
| 57 | <file name="log/test%TESTNUMBER.txt"> |
| 58 | Weird |
| 59 | file |
| 60 | to |
| 61 | upload |
| 62 | for |
| 63 | testing |
| 64 | the |
| 65 | PUT |
| 66 | feature |
| 67 | </file> |
| 68 | </client> |
| 69 | |
| 70 | # Verify data after the test has been "shot" |
| 71 | <verify> |
| 72 | |
| 73 | # The primary reason libcurl sends the data part twice in this test is that |
| 74 | # the test HTTP server is blocking until it has read the entire request, |
| 75 | # including the full request-body before it responds. So in this test the |
| 76 | # server says 301 and 200 _after_ the entire PUT body has been sent. |
| 77 | <protocol> |
| 78 | PUT /want/%TESTNUMBER HTTP/1.0
|
| 79 | Host: %HOSTIP:%HTTPPORT
|
| 80 | User-Agent: curl/%VERSION
|
| 81 | Accept: */*
|
| 82 | Content-Length: 78
|
| 83 |
|
| 84 | Weird |
| 85 | file |
| 86 | to |
| 87 | upload |
| 88 | for |
| 89 | testing |
| 90 | the |
| 91 | PUT |
| 92 | feature |
| 93 | PUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.0
|
| 94 | Host: %HOSTIP:%HTTPPORT
|
| 95 | User-Agent: curl/%VERSION
|
| 96 | Accept: */*
|
| 97 | Content-Length: 78
|
| 98 |
|
| 99 | Weird |
| 100 | file |
| 101 | to |
| 102 | upload |
| 103 | for |
| 104 | testing |
| 105 | the |
| 106 | PUT |
| 107 | feature |
| 108 | </protocol> |
| 109 | </verify> |
| 110 | </testcase> |