• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6HTTP Basic auth
7</keywords>
8</info>
9# Server-side
10<reply>
11
12<!-- First request has Basic auth, right password -->
13<data100>
14HTTP/1.1 200 Things are fine in server land
15Server: Microsoft-IIS/5.0
16Content-Type: text/html; charset=iso-8859-1
17Content-Length: 32
18
19Finally, this is the real page!
20</data100>
21
22<!-- Second request with Basic auth disabled -->
23<data200>
24HTTP/1.1 401 Sorry wrong password (2)
25Server: Microsoft-IIS/5.0
26Content-Type: text/html; charset=iso-8859-1
27Content-Length: 29
28WWW-Authenticate: Basic realm="testrealm"
29
30This is a bad password page!
31</data200>
32
33</reply>
34
35# Client-side
36<client>
37<server>
38http
39</server>
40<name>
41HTTP Basic authorization, then without authorization
42</name>
43<command option="no-output,no-include">
44-u testuser:testpass http://%HOSTIP:%HTTPPORT/20400100 --next --no-basic http://%HOSTIP:%HTTPPORT/20400200
45</command>
46</client>
47
48# Verify data after the test has been "shot"
49<verify>
50<strip>
51^User-Agent:.*
52</strip>
53<protocol>
54GET /20400100 HTTP/1.1
55Host: %HOSTIP:%HTTPPORT
56Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
57Accept: */*
58
59GET /20400200 HTTP/1.1
60Host: %HOSTIP:%HTTPPORT
61Accept: */*
62
63</protocol>
64<stdout>
65Finally, this is the real page!
66This is a bad password page!
67</stdout>
68</verify>
69</testcase>
70