Mercurial > hg > nginx-tests
annotate http_error_page.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 784151520a9a |
children |
rev | line source |
---|---|
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 # Tests for error_page directive. |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 ############################################################################### |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 use warnings; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 use strict; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 use Test::More; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 BEGIN { use FindBin; chdir($FindBin::Bin); } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 use lib 'lib'; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 use Test::Nginx; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 ############################################################################### |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 select STDERR; $| = 1; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 select STDOUT; $| = 1; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 |
1258
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
24 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(9) |
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 ->write_file_expand('nginx.conf', <<'EOF'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 %%TEST_GLOBALS%% |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 |
249
6a0d934950bc
Tests: remove extra spaces in "daemon off".
Maxim Dounin <mdounin@mdounin.ru>
parents:
177
diff
changeset
|
29 daemon off; |
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 events { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 http { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 %%TEST_GLOBALS_HTTP%% |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
38 listen 127.0.0.1:8080; |
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 server_name localhost; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 location /redirect200 { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 error_page 404 =200 http://example.com/; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 return 404; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
46 location /redirect497 { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 # 497 implies implicit status code change |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 error_page 497 https://example.com/; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 return 497; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 location /error302redirect { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 error_page 302 http://example.com/; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 return 302 "first"; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
55 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
56 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 location /error302return302text { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 error_page 302 /return302text; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
59 return 302 "first"; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
60 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
61 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
62 location /return302text { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
63 return 302 "http://example.com/"; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
64 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
65 |
1258
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
66 location /error302return302args { |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
67 error_page 302 /return302args?1; |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
68 return 302 "first"; |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
69 } |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
70 |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
71 location /error302return302varargs { |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
72 error_page 302 /return302args?$arg_a; |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
73 return 302 "first"; |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
74 } |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
75 |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
76 location /return302args { |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
77 return 302 "http://example.com/$args"; |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
78 } |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
79 |
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 location /error302rewrite { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 error_page 302 /rewrite; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 return 302 "first"; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 location /rewrite { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
86 rewrite ^ http://example.com/; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
88 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 location /error302directory { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 error_page 302 /directory; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
91 return 302 "first"; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
92 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
93 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
94 location /directory { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
95 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 location /error302auto { |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 error_page 302 /auto; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 return 302 "first"; |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 location /auto/ { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
103 proxy_pass http://127.0.0.1:8081; |
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 } |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
107 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 EOF |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
109 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
110 mkdir($t->testdir() . '/directory'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
111 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 $t->run(); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
113 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 ############################################################################### |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
115 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
116 # tests for error_page status code change for redirects. problems |
147
fd865ada95c8
Tests: error_page status code change fixed in 0.9.5.
Maxim Dounin <mdounin@mdounin.ru>
parents:
141
diff
changeset
|
117 # introduced in 0.8.53 and fixed in 0.9.5. |
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
118 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
119 like(http_get('/redirect200'), qr!HTTP!, 'redirect 200'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
120 like(http_get('/redirect497'), qr!HTTP/1.1 302!, 'redirect 497'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
121 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
122 # various tests to see if old location cleared if we happen to redirect |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
123 # again in error_page 302 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
124 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
125 like(http_get('/error302redirect'), |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
126 qr{HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/}ms, |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 'error 302 redirect - old location cleared'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
129 like(http_get('/error302return302text'), |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
130 qr{HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/}ms, |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
131 'error 302 return 302 text - old location cleared'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
132 |
1258
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
133 like(http_get('/error302return302args'), |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
134 qr{HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/1}ms, |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
135 'error 302 return 302 args - old location cleared'); |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
136 |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
137 like(http_get('/error302return302varargs?a=2'), |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
138 qr{HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/2}ms, |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
139 'error 302 return 302 var args - old location cleared'); |
784151520a9a
Tests: added error_page tests with args in internal redirect.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
140 |
141
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 like(http_get('/error302rewrite'), |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
142 qr{HTTP/1.1 302(?!.*Location: first).*Location: http://example.com/}ms, |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
143 'error 302 rewrite - old location cleared'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
144 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
145 like(http_get('/error302directory'), |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
146 qr{HTTP/1.1 301(?!.*Location: first).*Location: http://}ms, |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
147 'error 302 directory redirect - old location cleared'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
148 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
149 like(http_get('/error302auto'), |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
150 qr{HTTP/1.1 301(?!.*Location: first).*Location: http://}ms, |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
151 'error 302 auto redirect - old location cleared'); |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
152 |
1e1975cd25ef
Tests: error_page and return related tests, dav tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
153 ############################################################################### |