Commit e52243fa authored by David Golden's avatar David Golden

add max redirect test cases

parent 4fc545e6
new_args
max_redirect: 0
url
http://example.com/index.html
expected
<a href="http://example.com/index2.html">redirect</a>
----------
GET /index.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 302 Found
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/html
Content-Length: 53
Location: http://example.com/index2.html
<a href="http://example.com/index2.html">redirect</a>
----------
GET /index2.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 302 Found
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/html
Content-Length: 53
Location: http://example.com/index3.html
<a href="http://example.com/index3.html">redirect</a>
----------
GET /index3.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 200 OK
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/plain
Content-Length: 42
abcdefghijklmnopqrstuvwxyz1234567890abcdef
new_args
max_redirect: 1
url
http://example.com/index.html
expected
<a href="http://example.com/index3.html">redirect</a>
----------
GET /index.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 302 Found
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/html
Content-Length: 53
Location: http://example.com/index2.html
<a href="http://example.com/index2.html">redirect</a>
----------
GET /index2.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 302 Found
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/html
Content-Length: 53
Location: http://example.com/index3.html
<a href="http://example.com/index3.html">redirect</a>
----------
GET /index3.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 200 OK
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/plain
Content-Length: 42
abcdefghijklmnopqrstuvwxyz1234567890abcdef
new_args
max_redirect: 2
url
http://example.com/index.html
expected
abcdefghijklmnopqrstuvwxyz1234567890abcdef
----------
GET /index.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 302 Found
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/html
Content-Length: 53
Location: http://example.com/index2.html
<a href="http://example.com/index2.html">redirect</a>
----------
GET /index2.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 302 Found
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/html
Content-Length: 53
Location: http://example.com/index3.html
<a href="http://example.com/index3.html">redirect</a>
----------
GET /index3.html HTTP/1.1
Host: example.com
Connection: close
User-Agent: HTTP-Tiny/VERSION
----------
HTTP/1.1 200 OK
Date: Thu, 03 Feb 1994 00:00:00 GMT
Content-Type: text/plain
Content-Length: 42
abcdefghijklmnopqrstuvwxyz1234567890abcdef
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment