Mercurial > hg > nginx
annotate src/http/ngx_http_special_response.c @ 4824:90f3b4ea7992 release-1.3.5
nginx-1.3.5-RELEASE
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 21 Aug 2012 13:05:02 +0000 |
parents | 4a18bf1833a9 |
children | 812c4765c954 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
416
diff
changeset
|
6 |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
7 |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
8 #include <ngx_config.h> |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
9 #include <ngx_core.h> |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
10 #include <ngx_http.h> |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
11 #include <nginx.h> |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
14 static ngx_int_t ngx_http_send_error_page(ngx_http_request_t *r, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
15 ngx_http_err_page_t *err_page); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
16 static ngx_int_t ngx_http_send_special_response(ngx_http_request_t *r, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
17 ngx_http_core_loc_conf_t *clcf, ngx_uint_t err); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
18 static ngx_int_t ngx_http_send_refresh(ngx_http_request_t *r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
19 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
20 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
21 static u_char ngx_http_error_full_tail[] = |
1592 | 22 "<hr><center>" NGINX_VER "</center>" CRLF |
23 "</body>" CRLF | |
24 "</html>" CRLF | |
25 ; | |
26 | |
27 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
28 static u_char ngx_http_error_tail[] = |
1592 | 29 "<hr><center>nginx</center>" CRLF |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
30 "</body>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
31 "</html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
32 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
33 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
34 |
3316
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
35 static u_char ngx_http_msie_padding[] = |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
36 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
37 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
38 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
39 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
40 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
41 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
42 ; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
43 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
44 |
679 | 45 static u_char ngx_http_msie_refresh_head[] = |
46 "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL="; | |
47 | |
48 | |
49 static u_char ngx_http_msie_refresh_tail[] = | |
50 "\"></head><body></body></html>" CRLF; | |
51 | |
52 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
53 static char ngx_http_error_301_page[] = |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
54 "<html>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
55 "<head><title>301 Moved Permanently</title></head>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
56 "<body bgcolor=\"white\">" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
57 "<center><h1>301 Moved Permanently</h1></center>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
58 ; |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
59 |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
60 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
61 static char ngx_http_error_302_page[] = |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
62 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
63 "<head><title>302 Found</title></head>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
64 "<body bgcolor=\"white\">" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
65 "<center><h1>302 Found</h1></center>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
66 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
67 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
68 |
3631 | 69 static char ngx_http_error_303_page[] = |
70 "<html>" CRLF | |
71 "<head><title>303 See Other</title></head>" CRLF | |
72 "<body bgcolor=\"white\">" CRLF | |
73 "<center><h1>303 See Other</h1></center>" CRLF | |
74 ; | |
75 | |
76 | |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
77 static char ngx_http_error_307_page[] = |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
78 "<html>" CRLF |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
79 "<head><title>307 Temporary Redirect</title></head>" CRLF |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
80 "<body bgcolor=\"white\">" CRLF |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
81 "<center><h1>307 Temporary Redirect</h1></center>" CRLF |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
82 ; |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
83 |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
84 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
85 static char ngx_http_error_400_page[] = |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
86 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
87 "<head><title>400 Bad Request</title></head>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
88 "<body bgcolor=\"white\">" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
89 "<center><h1>400 Bad Request</h1></center>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
90 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
91 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
92 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
93 static char ngx_http_error_401_page[] = |
499 | 94 "<html>" CRLF |
503 | 95 "<head><title>401 Authorization Required</title></head>" CRLF |
499 | 96 "<body bgcolor=\"white\">" CRLF |
503 | 97 "<center><h1>401 Authorization Required</h1></center>" CRLF |
499 | 98 ; |
99 | |
100 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
101 static char ngx_http_error_402_page[] = |
499 | 102 "<html>" CRLF |
103 "<head><title>402 Payment Required</title></head>" CRLF | |
104 "<body bgcolor=\"white\">" CRLF | |
105 "<center><h1>402 Payment Required</h1></center>" CRLF | |
106 ; | |
107 | |
108 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
109 static char ngx_http_error_403_page[] = |
45
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
110 "<html>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
111 "<head><title>403 Forbidden</title></head>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
112 "<body bgcolor=\"white\">" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
113 "<center><h1>403 Forbidden</h1></center>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
114 ; |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
115 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
116 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
117 static char ngx_http_error_404_page[] = |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
118 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
119 "<head><title>404 Not Found</title></head>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
120 "<body bgcolor=\"white\">" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
121 "<center><h1>404 Not Found</h1></center>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
122 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
123 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
124 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
125 static char ngx_http_error_405_page[] = |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
126 "<html>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
127 "<head><title>405 Not Allowed</title></head>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
128 "<body bgcolor=\"white\">" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
129 "<center><h1>405 Not Allowed</h1></center>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
130 ; |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
131 |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
132 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
133 static char ngx_http_error_406_page[] = |
499 | 134 "<html>" CRLF |
135 "<head><title>406 Not Acceptable</title></head>" CRLF | |
136 "<body bgcolor=\"white\">" CRLF | |
137 "<center><h1>406 Not Acceptable</h1></center>" CRLF | |
138 ; | |
139 | |
140 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
141 static char ngx_http_error_408_page[] = |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
142 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
143 "<head><title>408 Request Time-out</title></head>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
144 "<body bgcolor=\"white\">" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
145 "<center><h1>408 Request Time-out</h1></center>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
146 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
147 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
148 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
149 static char ngx_http_error_409_page[] = |
637 | 150 "<html>" CRLF |
151 "<head><title>409 Conflict</title></head>" CRLF | |
152 "<body bgcolor=\"white\">" CRLF | |
153 "<center><h1>409 Conflict</h1></center>" CRLF | |
154 ; | |
155 | |
156 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
157 static char ngx_http_error_410_page[] = |
499 | 158 "<html>" CRLF |
159 "<head><title>410 Gone</title></head>" CRLF | |
160 "<body bgcolor=\"white\">" CRLF | |
161 "<center><h1>410 Gone</h1></center>" CRLF | |
162 ; | |
163 | |
164 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
165 static char ngx_http_error_411_page[] = |
581 | 166 "<html>" CRLF |
167 "<head><title>411 Length Required</title></head>" CRLF | |
168 "<body bgcolor=\"white\">" CRLF | |
169 "<center><h1>411 Length Required</h1></center>" CRLF | |
170 ; | |
171 | |
172 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
173 static char ngx_http_error_412_page[] = |
1057 | 174 "<html>" CRLF |
175 "<head><title>412 Precondition Failed</title></head>" CRLF | |
176 "<body bgcolor=\"white\">" CRLF | |
177 "<center><h1>412 Precondition Failed</h1></center>" CRLF | |
178 ; | |
179 | |
180 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
181 static char ngx_http_error_413_page[] = |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
182 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
183 "<head><title>413 Request Entity Too Large</title></head>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
184 "<body bgcolor=\"white\">" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
185 "<center><h1>413 Request Entity Too Large</h1></center>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
186 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
187 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
188 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
189 static char ngx_http_error_414_page[] = |
67
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
190 "<html>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
191 "<head><title>414 Request-URI Too Large</title></head>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
192 "<body bgcolor=\"white\">" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
193 "<center><h1>414 Request-URI Too Large</h1></center>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
194 ; |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
195 |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
196 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
197 static char ngx_http_error_415_page[] = |
637 | 198 "<html>" CRLF |
199 "<head><title>415 Unsupported Media Type</title></head>" CRLF | |
200 "<body bgcolor=\"white\">" CRLF | |
201 "<center><h1>415 Unsupported Media Type</h1></center>" CRLF | |
202 ; | |
203 | |
204 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
205 static char ngx_http_error_416_page[] = |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
206 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
207 "<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
208 "<body bgcolor=\"white\">" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
209 "<center><h1>416 Requested Range Not Satisfiable</h1></center>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
210 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
211 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
212 |
3848
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
213 static char ngx_http_error_494_page[] = |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
214 "<html>" CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
215 "<head><title>400 Request Header Or Cookie Too Large</title></head>" |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
216 CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
217 "<body bgcolor=\"white\">" CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
218 "<center><h1>400 Bad Request</h1></center>" CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
219 "<center>Request Header Or Cookie Too Large</center>" CRLF |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
220 ; |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
221 |
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
222 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
223 static char ngx_http_error_495_page[] = |
647 | 224 "<html>" CRLF |
225 "<head><title>400 The SSL certificate error</title></head>" | |
226 CRLF | |
227 "<body bgcolor=\"white\">" CRLF | |
228 "<center><h1>400 Bad Request</h1></center>" CRLF | |
229 "<center>The SSL certificate error</center>" CRLF | |
230 ; | |
231 | |
232 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
233 static char ngx_http_error_496_page[] = |
647 | 234 "<html>" CRLF |
235 "<head><title>400 No required SSL certificate was sent</title></head>" | |
236 CRLF | |
237 "<body bgcolor=\"white\">" CRLF | |
238 "<center><h1>400 Bad Request</h1></center>" CRLF | |
239 "<center>No required SSL certificate was sent</center>" CRLF | |
240 ; | |
241 | |
242 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
243 static char ngx_http_error_497_page[] = |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
244 "<html>" CRLF |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
245 "<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>" |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
246 CRLF |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
247 "<body bgcolor=\"white\">" CRLF |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
248 "<center><h1>400 Bad Request</h1></center>" CRLF |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
249 "<center>The plain HTTP request was sent to HTTPS port</center>" CRLF |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
250 ; |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
251 |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
252 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
253 static char ngx_http_error_500_page[] = |
47
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
254 "<html>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
255 "<head><title>500 Internal Server Error</title></head>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
256 "<body bgcolor=\"white\">" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
257 "<center><h1>500 Internal Server Error</h1></center>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
258 ; |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
259 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
260 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
261 static char ngx_http_error_501_page[] = |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
262 "<html>" CRLF |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
263 "<head><title>501 Method Not Implemented</title></head>" CRLF |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
264 "<body bgcolor=\"white\">" CRLF |
535 | 265 "<center><h1>501 Method Not Implemented</h1></center>" CRLF |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
266 ; |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
267 |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
268 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
269 static char ngx_http_error_502_page[] = |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
270 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
271 "<head><title>502 Bad Gateway</title></head>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
272 "<body bgcolor=\"white\">" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
273 "<center><h1>502 Bad Gateway</h1></center>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
274 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
275 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
276 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
277 static char ngx_http_error_503_page[] = |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
278 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
279 "<head><title>503 Service Temporarily Unavailable</title></head>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
280 "<body bgcolor=\"white\">" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
281 "<center><h1>503 Service Temporarily Unavailable</h1></center>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
282 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
283 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
284 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
285 static char ngx_http_error_504_page[] = |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
286 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
287 "<head><title>504 Gateway Time-out</title></head>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
288 "<body bgcolor=\"white\">" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
289 "<center><h1>504 Gateway Time-out</h1></center>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
290 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
291 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
292 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
293 static char ngx_http_error_507_page[] = |
637 | 294 "<html>" CRLF |
295 "<head><title>507 Insufficient Storage</title></head>" CRLF | |
296 "<body bgcolor=\"white\">" CRLF | |
297 "<center><h1>507 Insufficient Storage</h1></center>" CRLF | |
298 ; | |
299 | |
300 | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
301 static ngx_str_t ngx_http_error_pages[] = { |
499 | 302 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
303 ngx_null_string, /* 201, 204 */ |
511 | 304 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
305 #define NGX_HTTP_LAST_2XX 202 |
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
306 #define NGX_HTTP_OFF_3XX (NGX_HTTP_LAST_2XX - 201) |
511 | 307 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
308 /* ngx_null_string, */ /* 300 */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
309 ngx_string(ngx_http_error_301_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
310 ngx_string(ngx_http_error_302_page), |
3631 | 311 ngx_string(ngx_http_error_303_page), |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
312 ngx_null_string, /* 304 */ |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
313 ngx_null_string, /* 305 */ |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
314 ngx_null_string, /* 306 */ |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
315 ngx_string(ngx_http_error_307_page), |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
316 |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
317 #define NGX_HTTP_LAST_3XX 308 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
318 #define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) |
499 | 319 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
320 ngx_string(ngx_http_error_400_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
321 ngx_string(ngx_http_error_401_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
322 ngx_string(ngx_http_error_402_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
323 ngx_string(ngx_http_error_403_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
324 ngx_string(ngx_http_error_404_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
325 ngx_string(ngx_http_error_405_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
326 ngx_string(ngx_http_error_406_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
327 ngx_null_string, /* 407 */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
328 ngx_string(ngx_http_error_408_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
329 ngx_string(ngx_http_error_409_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
330 ngx_string(ngx_http_error_410_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
331 ngx_string(ngx_http_error_411_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
332 ngx_string(ngx_http_error_412_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
333 ngx_string(ngx_http_error_413_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
334 ngx_string(ngx_http_error_414_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
335 ngx_string(ngx_http_error_415_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
336 ngx_string(ngx_http_error_416_page), |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
337 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
338 #define NGX_HTTP_LAST_4XX 417 |
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
339 #define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX) |
499 | 340 |
3848
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
341 ngx_string(ngx_http_error_494_page), /* 494, request header too large */ |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
342 ngx_string(ngx_http_error_495_page), /* 495, https certificate error */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
343 ngx_string(ngx_http_error_496_page), /* 496, https no certificate */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
344 ngx_string(ngx_http_error_497_page), /* 497, http to https */ |
1672 | 345 ngx_string(ngx_http_error_404_page), /* 498, canceled */ |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
346 ngx_null_string, /* 499, client has closed connection */ |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
347 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
348 ngx_string(ngx_http_error_500_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
349 ngx_string(ngx_http_error_501_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
350 ngx_string(ngx_http_error_502_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
351 ngx_string(ngx_http_error_503_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
352 ngx_string(ngx_http_error_504_page), |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
353 ngx_null_string, /* 505 */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
354 ngx_null_string, /* 506 */ |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
355 ngx_string(ngx_http_error_507_page) |
2696 | 356 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
357 #define NGX_HTTP_LAST_5XX 508 |
2696 | 358 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
359 }; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
360 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
361 |
717
08652aae6fab
fix msvc build failure introduced by previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
716
diff
changeset
|
362 static ngx_str_t ngx_http_get_name = { 3, (u_char *) "GET " }; |
716
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
363 |
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
364 |
487 | 365 ngx_int_t |
366 ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) | |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
367 { |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
368 ngx_uint_t i, err; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
369 ngx_http_err_page_t *err_page; |
158
d377ee423603
nginx-0.0.1-2003-10-24-10:53:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
155
diff
changeset
|
370 ngx_http_core_loc_conf_t *clcf; |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
371 |
2040
eba265857dc2
fix building by bcc/etc introduced in r2038
Igor Sysoev <igor@sysoev.ru>
parents:
2037
diff
changeset
|
372 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
2037 | 373 "http special response: %d, \"%V?%V\"", |
374 error, &r->uri, &r->args); | |
527 | 375 |
677 | 376 r->err_status = error; |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
377 |
2019 | 378 if (r->keepalive) { |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
379 switch (error) { |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
380 case NGX_HTTP_BAD_REQUEST: |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
381 case NGX_HTTP_REQUEST_ENTITY_TOO_LARGE: |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
382 case NGX_HTTP_REQUEST_URI_TOO_LARGE: |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
383 case NGX_HTTP_TO_HTTPS: |
647 | 384 case NGX_HTTPS_CERT_ERROR: |
385 case NGX_HTTPS_NO_CERT: | |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
386 case NGX_HTTP_INTERNAL_SERVER_ERROR: |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
387 r->keepalive = 0; |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
388 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
389 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
390 |
4201
1d52dd2b5bb7
Stylistic change in checking the boolean expression.
Ruslan Ermilov <ru@nginx.com>
parents:
4146
diff
changeset
|
391 if (r->lingering_close) { |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
392 switch (error) { |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
393 case NGX_HTTP_BAD_REQUEST: |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
394 case NGX_HTTP_TO_HTTPS: |
647 | 395 case NGX_HTTPS_CERT_ERROR: |
396 case NGX_HTTPS_NO_CERT: | |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
397 r->lingering_close = 0; |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
398 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
399 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
400 |
675 | 401 r->headers_out.content_type.len = 0; |
402 | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
403 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
404 |
2174
20a7fc523aec
disable error_page loop in 500 error when recursive errors are enabled
Igor Sysoev <igor@sysoev.ru>
parents:
2040
diff
changeset
|
405 if (!r->error_page && clcf->error_pages && r->uri_changes != 0) { |
679 | 406 |
407 if (clcf->recursive_error_pages == 0) { | |
408 r->error_page = 1; | |
409 } | |
477 | 410 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
411 err_page = clcf->error_pages->elts; |
477 | 412 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
413 for (i = 0; i < clcf->error_pages->nelts; i++) { |
326
8733703a37f3
nginx-0.0.3-2004-04-26-00:13:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
414 if (err_page[i].status == error) { |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
415 return ngx_http_send_error_page(r, &err_page[i]); |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
416 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
417 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
418 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
419 |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
420 r->expect_tested = 1; |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
421 |
2191
808547aa8c12
do not discard body while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2174
diff
changeset
|
422 if (ngx_http_discard_request_body(r) != NGX_OK) { |
808547aa8c12
do not discard body while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2174
diff
changeset
|
423 error = NGX_HTTP_INTERNAL_SERVER_ERROR; |
808547aa8c12
do not discard body while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2174
diff
changeset
|
424 } |
808547aa8c12
do not discard body while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2174
diff
changeset
|
425 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
426 if (clcf->msie_refresh |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
427 && r->headers_in.msie |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
428 && (error == NGX_HTTP_MOVED_PERMANENTLY |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
429 || error == NGX_HTTP_MOVED_TEMPORARILY)) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
430 { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
431 return ngx_http_send_refresh(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
432 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
433 |
633 | 434 if (error == NGX_HTTP_CREATED) { |
435 /* 201 */ | |
436 err = 0; | |
437 | |
438 } else if (error == NGX_HTTP_NO_CONTENT) { | |
511 | 439 /* 204 */ |
440 err = 0; | |
441 | |
2696 | 442 } else if (error >= NGX_HTTP_MOVED_PERMANENTLY |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
443 && error < NGX_HTTP_LAST_3XX) |
2696 | 444 { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
445 /* 3XX */ |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
446 err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
447 |
2696 | 448 } else if (error >= NGX_HTTP_BAD_REQUEST |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
449 && error < NGX_HTTP_LAST_4XX) |
2696 | 450 { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
451 /* 4XX */ |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
452 err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_OFF_4XX; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
453 |
3845
11c68a5ed419
rename NGX_HTTP_OWN_CODES to NGX_HTTP_NGINX_CODES
Igor Sysoev <igor@sysoev.ru>
parents:
3781
diff
changeset
|
454 } else if (error >= NGX_HTTP_NGINX_CODES |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
455 && error < NGX_HTTP_LAST_5XX) |
2696 | 456 { |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
457 /* 49X, 5XX */ |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
458 err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_OFF_5XX; |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
459 switch (error) { |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
460 case NGX_HTTP_TO_HTTPS: |
647 | 461 case NGX_HTTPS_CERT_ERROR: |
462 case NGX_HTTPS_NO_CERT: | |
3848
de59ad6bf557
introduce 494 code "Request Header Too Large"
Igor Sysoev <igor@sysoev.ru>
parents:
3845
diff
changeset
|
463 case NGX_HTTP_REQUEST_HEADER_TOO_LARGE: |
679 | 464 r->err_status = NGX_HTTP_BAD_REQUEST; |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
465 break; |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
466 } |
2696 | 467 |
468 } else { | |
469 /* unknown code, zero body */ | |
470 err = 0; | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
471 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
472 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
473 return ngx_http_send_special_response(r, clcf, err); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
474 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
475 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
476 |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
477 ngx_int_t |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
478 ngx_http_filter_finalize_request(ngx_http_request_t *r, ngx_module_t *m, |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
479 ngx_int_t error) |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
480 { |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
481 void *ctx; |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
482 ngx_int_t rc; |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
483 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
484 ngx_http_clean_header(r); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
485 |
2822 | 486 ctx = NULL; |
487 | |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
488 if (m) { |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
489 ctx = r->ctx[m->ctx_index]; |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
490 } |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
491 |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
492 /* clear the modules contexts */ |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
493 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
494 |
2821
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
495 if (m) { |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
496 r->ctx[m->ctx_index] = ctx; |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
497 } |
26e06e009ced
allow to pass image filter errors via the same location where the filter is set
Igor Sysoev <igor@sysoev.ru>
parents:
2819
diff
changeset
|
498 |
2819
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
499 r->filter_finalize = 1; |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
500 |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
501 rc = ngx_http_special_response_handler(r, error); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
502 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
503 /* NGX_ERROR resets any pending data */ |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
504 |
2819
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
505 switch (rc) { |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
506 |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
507 case NGX_OK: |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
508 case NGX_DONE: |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
509 return NGX_ERROR; |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
510 |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
511 default: |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
512 return rc; |
43fe53832da7
handle big responses for "size" and "test" image_filters
Igor Sysoev <igor@sysoev.ru>
parents:
2787
diff
changeset
|
513 } |
2787
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
514 } |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
515 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
516 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
517 void |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
518 ngx_http_clean_header(ngx_http_request_t *r) |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
519 { |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
520 ngx_memzero(&r->headers_out.status, |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
521 sizeof(ngx_http_headers_out_t) |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
522 - offsetof(ngx_http_headers_out_t, status)); |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
523 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
524 r->headers_out.headers.part.nelts = 0; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
525 r->headers_out.headers.part.next = NULL; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
526 r->headers_out.headers.last = &r->headers_out.headers.part; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
527 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
528 r->headers_out.content_length_n = -1; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
529 r->headers_out.last_modified_time = -1; |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
530 } |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
531 |
3daf68f2efe3
ngx_http_filter_finalize_request() and ngx_http_clean_header()
Igor Sysoev <igor@sysoev.ru>
parents:
2696
diff
changeset
|
532 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
533 static ngx_int_t |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
534 ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
535 { |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
536 ngx_int_t overwrite; |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
537 ngx_str_t uri, args; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
538 ngx_table_elt_t *location; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
539 ngx_http_core_loc_conf_t *clcf; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
540 |
2436
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
541 overwrite = err_page->overwrite; |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
542 |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
543 if (overwrite && overwrite != NGX_HTTP_OK) { |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
544 r->expect_tested = 1; |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
545 } |
26d9d4a41e91
send "100 Continue" just before reading request body
Igor Sysoev <igor@sysoev.ru>
parents:
2192
diff
changeset
|
546 |
3781
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
547 if (overwrite >= 0) { |
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
548 r->err_status = overwrite; |
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
549 } |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
550 |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
551 if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) { |
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
552 return NGX_ERROR; |
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
553 } |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
554 |
2685
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
555 if (uri.data[0] == '/') { |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
556 |
2685
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
557 if (err_page->value.lengths) { |
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
558 ngx_http_split_args(r, &uri, &args); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
559 |
2685
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
560 } else { |
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
561 args = err_page->args; |
6c8a5165ed2a
fix r2590: error_page made an external redirect without query string
Igor Sysoev <igor@sysoev.ru>
parents:
2589
diff
changeset
|
562 } |
1922
d23396f2a902
do not change method while error redirection to named location
Igor Sysoev <igor@sysoev.ru>
parents:
1672
diff
changeset
|
563 |
2192
798ecc4fe75c
leave HEAD method while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2191
diff
changeset
|
564 if (r->method != NGX_HTTP_HEAD) { |
798ecc4fe75c
leave HEAD method while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2191
diff
changeset
|
565 r->method = NGX_HTTP_GET; |
798ecc4fe75c
leave HEAD method while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2191
diff
changeset
|
566 r->method_name = ngx_http_get_name; |
798ecc4fe75c
leave HEAD method while error_page redirection
Igor Sysoev <igor@sysoev.ru>
parents:
2191
diff
changeset
|
567 } |
1922
d23396f2a902
do not change method while error redirection to named location
Igor Sysoev <igor@sysoev.ru>
parents:
1672
diff
changeset
|
568 |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
569 return ngx_http_internal_redirect(r, &uri, &args); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
570 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
571 |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
572 if (uri.data[0] == '@') { |
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
573 return ngx_http_named_location(r, &uri); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
574 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
575 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
576 location = ngx_list_push(&r->headers_out.headers); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
577 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
578 if (location == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
579 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
580 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
581 |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
582 if (overwrite != NGX_HTTP_MOVED_PERMANENTLY |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
583 && overwrite != NGX_HTTP_MOVED_TEMPORARILY |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
584 && overwrite != NGX_HTTP_SEE_OTHER |
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4490
diff
changeset
|
585 && overwrite != NGX_HTTP_TEMPORARY_REDIRECT) |
3860
39ad979cd31e
fix "error_page 497 https://" case
Igor Sysoev <igor@sysoev.ru>
parents:
3848
diff
changeset
|
586 { |
39ad979cd31e
fix "error_page 497 https://" case
Igor Sysoev <igor@sysoev.ru>
parents:
3848
diff
changeset
|
587 r->err_status = NGX_HTTP_MOVED_TEMPORARILY; |
39ad979cd31e
fix "error_page 497 https://" case
Igor Sysoev <igor@sysoev.ru>
parents:
3848
diff
changeset
|
588 } |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
589 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
590 location->hash = 1; |
3516
dd1570b6f237
ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents:
3316
diff
changeset
|
591 ngx_str_set(&location->key, "Location"); |
2589
859f6675a553
use complex value in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
2436
diff
changeset
|
592 location->value = uri; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
593 |
4206
1a94a56a4e5d
Clear old Location header (if any) while adding a new one.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4201
diff
changeset
|
594 ngx_http_clear_location(r); |
1a94a56a4e5d
Clear old Location header (if any) while adding a new one.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4201
diff
changeset
|
595 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
596 r->headers_out.location = location; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
597 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
598 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
599 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
600 if (clcf->msie_refresh && r->headers_in.msie) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
601 return ngx_http_send_refresh(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
602 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
603 |
3781
173a45374a97
allow override redirect status in error_page
Igor Sysoev <igor@sysoev.ru>
parents:
3663
diff
changeset
|
604 return ngx_http_send_special_response(r, clcf, r->err_status |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
605 - NGX_HTTP_MOVED_PERMANENTLY |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
606 + NGX_HTTP_OFF_3XX); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
607 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
608 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
609 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
610 static ngx_int_t |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
611 ngx_http_send_special_response(ngx_http_request_t *r, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
612 ngx_http_core_loc_conf_t *clcf, ngx_uint_t err) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
613 { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
614 u_char *tail; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
615 size_t len; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
616 ngx_int_t rc; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
617 ngx_buf_t *b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
618 ngx_uint_t msie_padding; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
619 ngx_chain_t out[3]; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
620 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
621 if (clcf->server_tokens) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
622 len = sizeof(ngx_http_error_full_tail) - 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
623 tail = ngx_http_error_full_tail; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
624 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
625 } else { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
626 len = sizeof(ngx_http_error_tail) - 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
627 tail = ngx_http_error_tail; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
628 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
629 |
356
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
630 msie_padding = 0; |
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
631 |
3663
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
632 if (ngx_http_error_pages[err].len) { |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
633 r->headers_out.content_length_n = ngx_http_error_pages[err].len + len; |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
634 if (clcf->msie_padding |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
635 && (r->headers_in.msie || r->headers_in.chrome) |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
636 && r->http_version >= NGX_HTTP_VERSION_10 |
4490
0cc1b430a0e6
Renamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
637 && err >= NGX_HTTP_OFF_4XX) |
3663
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
638 { |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
639 r->headers_out.content_length_n += |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
640 sizeof(ngx_http_msie_padding) - 1; |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
641 msie_padding = 1; |
331
f168a88e93f7
nginx-0.0.3-2004-05-04-21:56:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
326
diff
changeset
|
642 } |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
643 |
3663
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
644 r->headers_out.content_type_len = sizeof("text/html") - 1; |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
645 ngx_str_set(&r->headers_out.content_type, "text/html"); |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
646 r->headers_out.content_type_lowcase = NULL; |
4a643a230686
remove r->zero_body unused since the previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
3631
diff
changeset
|
647 |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
648 } else { |
4146
55acacac22df
Fix for incorrect 201 replies from dav module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3860
diff
changeset
|
649 r->headers_out.content_length_n = 0; |
165
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
650 } |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
651 |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
652 if (r->headers_out.content_length) { |
509 | 653 r->headers_out.content_length->hash = 0; |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
654 r->headers_out.content_length = NULL; |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
655 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
656 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
657 ngx_http_clear_accept_ranges(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
658 ngx_http_clear_last_modified(r); |
4746
4a18bf1833a9
Entity tags: clear on entity changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4491
diff
changeset
|
659 ngx_http_clear_etag(r); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
660 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
661 rc = ngx_http_send_header(r); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
662 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
663 if (rc == NGX_ERROR || r->header_only) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
664 return rc; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
665 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
666 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
667 if (ngx_http_error_pages[err].len == 0) { |
4146
55acacac22df
Fix for incorrect 201 replies from dav module.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3860
diff
changeset
|
668 return ngx_http_send_special(r, NGX_HTTP_LAST); |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
669 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
670 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
671 b = ngx_calloc_buf(r->pool); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
672 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
673 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
674 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
675 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
676 b->memory = 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
677 b->pos = ngx_http_error_pages[err].data; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
678 b->last = ngx_http_error_pages[err].data + ngx_http_error_pages[err].len; |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
679 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
680 out[0].buf = b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
681 out[0].next = &out[1]; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
682 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
683 b = ngx_calloc_buf(r->pool); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
684 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
685 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
686 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
687 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
688 b->memory = 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
689 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
690 b->pos = tail; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
691 b->last = tail + len; |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
692 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
693 out[1].buf = b; |
2024 | 694 out[1].next = NULL; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
695 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
696 if (msie_padding) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
697 b = ngx_calloc_buf(r->pool); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
698 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
699 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
700 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
701 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
702 b->memory = 1; |
3316
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
703 b->pos = ngx_http_msie_padding; |
a63dd08379c4
add MSIE padding for Chrome too
Igor Sysoev <igor@sysoev.ru>
parents:
2882
diff
changeset
|
704 b->last = ngx_http_msie_padding + sizeof(ngx_http_msie_padding) - 1; |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
705 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
706 out[1].next = &out[2]; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
707 out[2].buf = b; |
2024 | 708 out[2].next = NULL; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
709 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
710 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
711 if (r == r->main) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
712 b->last_buf = 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
713 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
714 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
715 b->last_in_chain = 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
716 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
717 return ngx_http_output_filter(r, &out[0]); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
718 } |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
719 |
679 | 720 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
721 static ngx_int_t |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
722 ngx_http_send_refresh(ngx_http_request_t *r) |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
723 { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
724 u_char *p, *location; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
725 size_t len, size; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
726 uintptr_t escape; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
727 ngx_int_t rc; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
728 ngx_buf_t *b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
729 ngx_chain_t out; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
730 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
731 len = r->headers_out.location->value.len; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
732 location = r->headers_out.location->value.data; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
733 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
734 escape = 2 * ngx_escape_uri(NULL, location, len, NGX_ESCAPE_REFRESH); |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
735 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
736 size = sizeof(ngx_http_msie_refresh_head) - 1 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
737 + escape + len |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
738 + sizeof(ngx_http_msie_refresh_tail) - 1; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
739 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
740 r->err_status = NGX_HTTP_OK; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
741 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
742 r->headers_out.content_type_len = sizeof("text/html") - 1; |
3516
dd1570b6f237
ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents:
3316
diff
changeset
|
743 ngx_str_set(&r->headers_out.content_type, "text/html"); |
2882
896db5a09bd2
reset content_type hash value, this fixes a bug when XSLT responses
Igor Sysoev <igor@sysoev.ru>
parents:
2822
diff
changeset
|
744 r->headers_out.content_type_lowcase = NULL; |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
745 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
746 r->headers_out.location->hash = 0; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
747 r->headers_out.location = NULL; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
748 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
749 r->headers_out.content_length_n = size; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
750 |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
751 if (r->headers_out.content_length) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
752 r->headers_out.content_length->hash = 0; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
753 r->headers_out.content_length = NULL; |
679 | 754 } |
755 | |
577 | 756 ngx_http_clear_accept_ranges(r); |
757 ngx_http_clear_last_modified(r); | |
4746
4a18bf1833a9
Entity tags: clear on entity changes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4491
diff
changeset
|
758 ngx_http_clear_etag(r); |
577 | 759 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
760 rc = ngx_http_send_header(r); |
142
cb77c084acdb
nginx-0.0.1-2003-10-09-11:00:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
761 |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
142
diff
changeset
|
762 if (rc == NGX_ERROR || r->header_only) { |
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
142
diff
changeset
|
763 return rc; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
764 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
765 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
766 b = ngx_create_temp_buf(r->pool, size); |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
767 if (b == NULL) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
768 return NGX_ERROR; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
769 } |
1592 | 770 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
771 p = ngx_cpymem(b->pos, ngx_http_msie_refresh_head, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
772 sizeof(ngx_http_msie_refresh_head) - 1); |
679 | 773 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
774 if (escape == 0) { |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
775 p = ngx_cpymem(p, location, len); |
679 | 776 |
777 } else { | |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
778 p = (u_char *) ngx_escape_uri(p, location, len, NGX_ESCAPE_REFRESH); |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
779 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
780 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
781 b->last = ngx_cpymem(p, ngx_http_msie_refresh_tail, |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
782 sizeof(ngx_http_msie_refresh_tail) - 1); |
509 | 783 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
784 b->last_buf = 1; |
509 | 785 b->last_in_chain = 1; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
786 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
787 out.buf = b; |
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
788 out.next = NULL; |
501 | 789 |
1604
e27930ae2b8f
divide special response handling into several functions
Igor Sysoev <igor@sysoev.ru>
parents:
1592
diff
changeset
|
790 return ngx_http_output_filter(r, &out); |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
791 } |