lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP proxy |
| 6 | HTTP Basic auth |
| 7 | HTTP proxy Basic auth |
| 8 | followlocation |
| 9 | --anyauth |
| 10 | --location-trusted |
| 11 | </keywords> |
| 12 | </info> |
| 13 | |
| 14 | # |
| 15 | # Server-side |
| 16 | <reply> |
| 17 | <data1000 nocheck="yes"> |
| 18 | HTTP/1.1 401 Authorization Required
|
| 19 | WWW-Authenticate: Basic
|
| 20 | Content-Type: text/plain
|
| 21 | Content-Length: 0
|
| 22 |
|
| 23 | </data1000> |
| 24 | <data1001 nocheck="yes"> |
| 25 | HTTP/1.1 302 OK
|
| 26 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 27 | Server: test-server/fake swsclose
|
| 28 | Content-Type: text/plain
|
| 29 | Funny-head: yesyes
|
| 30 | Location: http://goto.second.host.now/10881002
|
| 31 | Content-Length: 0
|
| 32 | Connection: close
|
| 33 |
|
| 34 | </data1001> |
| 35 | <data1003 nocheck="yes"> |
| 36 | HTTP/1.1 200 OK
|
| 37 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 38 | Server: test-server/fake swsclose
|
| 39 | Content-Type: text/plain
|
| 40 | Funny-head: yesyes
|
| 41 | Content-Length: 9
|
| 42 |
|
| 43 | contents |
| 44 | </data1003> |
| 45 | |
| 46 | <datacheck> |
| 47 | HTTP/1.1 401 Authorization Required
|
| 48 | WWW-Authenticate: Basic
|
| 49 | Content-Type: text/plain
|
| 50 | Content-Length: 0
|
| 51 |
|
| 52 | HTTP/1.1 302 OK
|
| 53 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 54 | Server: test-server/fake swsclose
|
| 55 | Content-Type: text/plain
|
| 56 | Funny-head: yesyes
|
| 57 | Location: http://goto.second.host.now/10881002
|
| 58 | Content-Length: 0
|
| 59 | Connection: close
|
| 60 |
|
| 61 | HTTP/1.1 200 OK
|
| 62 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 63 | Server: test-server/fake swsclose
|
| 64 | Content-Type: text/plain
|
| 65 | Funny-head: yesyes
|
| 66 | Content-Length: 9
|
| 67 |
|
| 68 | contents |
| 69 | </datacheck> |
| 70 | </reply> |
| 71 | |
| 72 | # |
| 73 | # Client-side |
| 74 | <client> |
| 75 | <server> |
| 76 | http |
| 77 | </server> |
| 78 | <name> |
| 79 | HTTP, proxy with --anyauth and Location: to new host using location-trusted |
| 80 | </name> |
| 81 | <command> |
| 82 | http://first.host.it.is/we/want/that/page/10881000 -x %HOSTIP:%HTTPPORT --user iam:myself --location-trusted --anyauth |
| 83 | </command> |
| 84 | </client> |
| 85 | |
| 86 | # |
| 87 | # Verify data after the test has been "shot" |
| 88 | <verify> |
| 89 | <strip> |
| 90 | ^User-Agent:.* |
| 91 | </strip> |
| 92 | <protocol> |
| 93 | GET http://first.host.it.is/we/want/that/page/10881000 HTTP/1.1
|
| 94 | Host: first.host.it.is
|
| 95 | Accept: */*
|
| 96 | Proxy-Connection: Keep-Alive
|
| 97 |
|
| 98 | GET http://first.host.it.is/we/want/that/page/10881000 HTTP/1.1
|
| 99 | Host: first.host.it.is
|
| 100 | Authorization: Basic aWFtOm15c2VsZg==
|
| 101 | Accept: */*
|
| 102 | Proxy-Connection: Keep-Alive
|
| 103 |
|
| 104 | GET http://goto.second.host.now/10881002 HTTP/1.1
|
| 105 | Host: goto.second.host.now
|
| 106 | Authorization: Basic aWFtOm15c2VsZg==
|
| 107 | Accept: */*
|
| 108 | Proxy-Connection: Keep-Alive
|
| 109 |
|
| 110 | </protocol> |
| 111 | </verify> |
| 112 | </testcase> |