Mercurial > hg > nginx-tests
comparison http_absolute_redirect.t @ 1154:2c120aea4362
Tests: added auto redirect tests with args.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 24 Mar 2017 19:33:11 +0300 |
parents | 818fbc9d1c29 |
children | 766bcbb632ee |
comparison
equal
deleted
inserted
replaced
1153:818fbc9d1c29 | 1154:2c120aea4362 |
---|---|
80 | 80 |
81 EOF | 81 EOF |
82 | 82 |
83 mkdir($t->testdir() . '/dir'); | 83 mkdir($t->testdir() . '/dir'); |
84 | 84 |
85 $t->try_run('no absolute_redirect')->plan(8); | 85 $t->try_run('no absolute_redirect')->plan(10); |
86 | 86 |
87 ############################################################################### | 87 ############################################################################### |
88 | 88 |
89 my $p = port(8080); | 89 my $p = port(8080); |
90 | 90 |
91 like(get('on', '/dir'), qr!Location: http://on:$p/dir/\x0d?$!m, 'directory'); | 91 like(get('on', '/dir'), qr!Location: http://on:$p/dir/\x0d?$!m, 'directory'); |
92 like(get('on', '/i/dir'), qr!Location: http://on:$p/i/dir/\x0d?$!m, | 92 like(get('on', '/i/dir'), qr!Location: http://on:$p/i/dir/\x0d?$!m, |
93 'directory alias'); | 93 'directory alias'); |
94 like(get('on', '/auto'), qr!Location: http://on:$p/auto/\x0d?$!m, 'auto'); | 94 like(get('on', '/auto'), qr!Location: http://on:$p/auto/\x0d?$!m, 'auto'); |
95 like(get('on', '/auto?a=b'), qr!Location: http://on:$p/auto/\?a=b\x0d?$!m, | |
96 'auto args'); | |
95 like(get('on', '/return301'), qr!Location: http://on:$p/redirect\x0d?$!m, | 97 like(get('on', '/return301'), qr!Location: http://on:$p/redirect\x0d?$!m, |
96 'return'); | 98 'return'); |
97 | 99 |
98 like(get('off', '/dir'), qr!Location: /dir/\x0d?$!m, 'off directory'); | 100 like(get('off', '/dir'), qr!Location: /dir/\x0d?$!m, 'off directory'); |
99 like(get('off', '/i/dir'), qr!Location: /i/dir/\x0d?$!m, 'off directory alias'); | 101 like(get('off', '/i/dir'), qr!Location: /i/dir/\x0d?$!m, 'off directory alias'); |
100 like(get('off', '/auto'), qr!Location: /auto/\x0d?$!m, 'off auto'); | 102 like(get('off', '/auto'), qr!Location: /auto/\x0d?$!m, 'off auto'); |
103 like(get('off', '/auto?a=b'), qr!Location: /auto/\?a=b\x0d?$!m, | |
104 'off auto args'); | |
101 like(get('off', '/return301'), qr!Location: /redirect\x0d?$!m, 'off return'); | 105 like(get('off', '/return301'), qr!Location: /redirect\x0d?$!m, 'off return'); |
102 | 106 |
103 ############################################################################### | 107 ############################################################################### |
104 | 108 |
105 sub get { | 109 sub get { |