Mercurial > hg > nginx-quic
annotate src/http/ngx_http_special_response.c @ 1436:ccbf588fb517
win32 ngx_is_exec() stub
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 30 Aug 2007 18:57:38 +0000 |
parents | cc114c85be0f |
children | 128ea9efb824 |
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 |
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
|
4 */ |
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 |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
6 |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
96
diff
changeset
|
7 #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
|
8 #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
|
9 #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
|
10 #include <nginx.h> |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
233
diff
changeset
|
13 static u_char error_tail[] = |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
14 "<hr><center>" NGINX_VER "</center>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
15 "</body>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
16 "</html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
17 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
18 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
19 |
501 | 20 static u_char ngx_http_msie_stub[] = |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
21 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
22 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
23 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
24 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
25 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
26 "<!-- The padding to disable MSIE's friendly error page -->" CRLF |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
27 ; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
28 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
29 |
679 | 30 static u_char ngx_http_msie_refresh_head[] = |
31 "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL="; | |
32 | |
33 | |
34 static u_char ngx_http_msie_refresh_tail[] = | |
35 "\"></head><body></body></html>" CRLF; | |
36 | |
37 | |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
38 static char error_301_page[] = |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
39 "<html>" CRLF |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
40 "<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
|
41 "<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
|
42 "<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
|
43 ; |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
44 |
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
45 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
46 static char error_302_page[] = |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
47 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
48 "<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
|
49 "<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
|
50 "<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
|
51 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
52 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
53 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
54 static char error_400_page[] = |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
55 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
56 "<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
|
57 "<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
|
58 "<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
|
59 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
60 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
61 |
499 | 62 static char error_401_page[] = |
63 "<html>" CRLF | |
503 | 64 "<head><title>401 Authorization Required</title></head>" CRLF |
499 | 65 "<body bgcolor=\"white\">" CRLF |
503 | 66 "<center><h1>401 Authorization Required</h1></center>" CRLF |
499 | 67 ; |
68 | |
69 | |
70 static char error_402_page[] = | |
71 "<html>" CRLF | |
72 "<head><title>402 Payment Required</title></head>" CRLF | |
73 "<body bgcolor=\"white\">" CRLF | |
74 "<center><h1>402 Payment Required</h1></center>" CRLF | |
75 ; | |
76 | |
77 | |
45
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
78 static char error_403_page[] = |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
79 "<html>" CRLF |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
80 "<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
|
81 "<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
|
82 "<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
|
83 ; |
f1ee46c036a4
nginx-0.0.1-2003-01-10-09:09:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
84 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
85 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
86 static char error_404_page[] = |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
87 "<html>" CRLF |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
88 "<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
|
89 "<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
|
90 "<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
|
91 ; |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
92 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
93 |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
94 static char error_405_page[] = |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
95 "<html>" CRLF |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
96 "<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
|
97 "<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
|
98 "<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
|
99 ; |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
100 |
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
101 |
499 | 102 static char error_406_page[] = |
103 "<html>" CRLF | |
104 "<head><title>406 Not Acceptable</title></head>" CRLF | |
105 "<body bgcolor=\"white\">" CRLF | |
106 "<center><h1>406 Not Acceptable</h1></center>" CRLF | |
107 ; | |
108 | |
109 | |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
110 static char error_408_page[] = |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
111 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
112 "<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
|
113 "<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
|
114 "<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
|
115 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
116 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
117 |
637 | 118 static char error_409_page[] = |
119 "<html>" CRLF | |
120 "<head><title>409 Conflict</title></head>" CRLF | |
121 "<body bgcolor=\"white\">" CRLF | |
122 "<center><h1>409 Conflict</h1></center>" CRLF | |
123 ; | |
124 | |
125 | |
499 | 126 static char error_410_page[] = |
127 "<html>" CRLF | |
128 "<head><title>410 Gone</title></head>" CRLF | |
129 "<body bgcolor=\"white\">" CRLF | |
130 "<center><h1>410 Gone</h1></center>" CRLF | |
131 ; | |
132 | |
133 | |
581 | 134 static char error_411_page[] = |
135 "<html>" CRLF | |
136 "<head><title>411 Length Required</title></head>" CRLF | |
137 "<body bgcolor=\"white\">" CRLF | |
138 "<center><h1>411 Length Required</h1></center>" CRLF | |
139 ; | |
140 | |
141 | |
1057 | 142 static char error_412_page[] = |
143 "<html>" CRLF | |
144 "<head><title>412 Precondition Failed</title></head>" CRLF | |
145 "<body bgcolor=\"white\">" CRLF | |
146 "<center><h1>412 Precondition Failed</h1></center>" CRLF | |
147 ; | |
148 | |
149 | |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
150 static char error_413_page[] = |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
151 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
152 "<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
|
153 "<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
|
154 "<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
|
155 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
156 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
157 |
67
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
158 static char error_414_page[] = |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
159 "<html>" CRLF |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
160 "<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
|
161 "<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
|
162 "<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
|
163 ; |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
164 |
5a7d1aaa1618
nginx-0.0.1-2003-03-11-23:38:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
59
diff
changeset
|
165 |
637 | 166 static char error_415_page[] = |
167 "<html>" CRLF | |
168 "<head><title>415 Unsupported Media Type</title></head>" CRLF | |
169 "<body bgcolor=\"white\">" CRLF | |
170 "<center><h1>415 Unsupported Media Type</h1></center>" CRLF | |
171 ; | |
172 | |
173 | |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
174 static char error_416_page[] = |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
175 "<html>" CRLF |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
176 "<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
|
177 "<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
|
178 "<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
|
179 ; |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
180 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
181 |
647 | 182 static char error_495_page[] = |
183 "<html>" CRLF | |
184 "<head><title>400 The SSL certificate error</title></head>" | |
185 CRLF | |
186 "<body bgcolor=\"white\">" CRLF | |
187 "<center><h1>400 Bad Request</h1></center>" CRLF | |
188 "<center>The SSL certificate error</center>" CRLF | |
189 ; | |
190 | |
191 | |
192 static char error_496_page[] = | |
193 "<html>" CRLF | |
194 "<head><title>400 No required SSL certificate was sent</title></head>" | |
195 CRLF | |
196 "<body bgcolor=\"white\">" CRLF | |
197 "<center><h1>400 Bad Request</h1></center>" CRLF | |
198 "<center>No required SSL certificate was sent</center>" CRLF | |
199 ; | |
200 | |
201 | |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
202 static char error_497_page[] = |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
203 "<html>" CRLF |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
204 "<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
|
205 CRLF |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
206 "<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
|
207 "<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
|
208 "<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
|
209 ; |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
210 |
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
211 |
47
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
212 static char error_500_page[] = |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
213 "<html>" CRLF |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
214 "<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
|
215 "<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
|
216 "<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
|
217 ; |
d81326c3b21b
nginx-0.0.1-2003-01-15-10:02:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
45
diff
changeset
|
218 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
219 |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
220 static char error_501_page[] = |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
221 "<html>" CRLF |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
222 "<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
|
223 "<body bgcolor=\"white\">" CRLF |
535 | 224 "<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
|
225 ; |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
226 |
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
227 |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
228 static char error_502_page[] = |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
229 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
230 "<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
|
231 "<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
|
232 "<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
|
233 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
234 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
235 |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
236 static char error_503_page[] = |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
237 "<html>" CRLF |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
238 "<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
|
239 "<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
|
240 "<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
|
241 ; |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
242 |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
243 |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
244 static char error_504_page[] = |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
245 "<html>" CRLF |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
246 "<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
|
247 "<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
|
248 "<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
|
249 ; |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
250 |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
251 |
637 | 252 static char error_507_page[] = |
253 "<html>" CRLF | |
254 "<head><title>507 Insufficient Storage</title></head>" CRLF | |
255 "<body bgcolor=\"white\">" CRLF | |
256 "<center><h1>507 Insufficient Storage</h1></center>" CRLF | |
257 ; | |
258 | |
259 | |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
260 static ngx_str_t error_pages[] = { |
499 | 261 |
633 | 262 ngx_null_string, /* 201, 204 */ |
511 | 263 |
264 #define NGX_HTTP_LEVEL_200 1 | |
265 | |
499 | 266 /* ngx_null_string, */ /* 300 */ |
144
ef8c87afcfc5
nginx-0.0.1-2003-10-12-20:49:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
143
diff
changeset
|
267 ngx_string(error_301_page), |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
268 ngx_string(error_302_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
269 ngx_null_string, /* 303 */ |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
270 |
499 | 271 #define NGX_HTTP_LEVEL_300 3 |
272 | |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
273 ngx_string(error_400_page), |
499 | 274 ngx_string(error_401_page), |
275 ngx_string(error_402_page), | |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
276 ngx_string(error_403_page), |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
277 ngx_string(error_404_page), |
96
a23d010f356d
nginx-0.0.1-2003-05-27-16:18:54 import
Igor Sysoev <igor@sysoev.ru>
parents:
88
diff
changeset
|
278 ngx_string(error_405_page), |
499 | 279 ngx_string(error_406_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
280 ngx_null_string, /* 407 */ |
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
281 ngx_string(error_408_page), |
637 | 282 ngx_string(error_409_page), |
499 | 283 ngx_string(error_410_page), |
581 | 284 ngx_string(error_411_page), |
1057 | 285 ngx_string(error_412_page), |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
286 ngx_string(error_413_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
287 ngx_string(error_414_page), |
637 | 288 ngx_string(error_415_page), |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
289 ngx_string(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
|
290 |
499 | 291 #define NGX_HTTP_LEVEL_400 17 |
292 | |
647 | 293 ngx_string(error_495_page), /* 495, https certificate error */ |
294 ngx_string(error_496_page), /* 496, https no certificate */ | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
384
diff
changeset
|
295 ngx_string(error_497_page), /* 497, http to https */ |
384
e7054aaedf68
nginx-0.0.7-2004-07-09-11:12:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
356
diff
changeset
|
296 ngx_string(error_404_page), /* 498, invalid host name */ |
499 | 297 ngx_null_string, /* 499, client had closed connection */ |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
298 |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
299 ngx_string(error_500_page), |
233
4eaafcd57be7
nginx-0.0.1-2004-01-19-21:09:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
300 ngx_string(error_501_page), |
69
e43f406e4525
nginx-0.0.1-2003-03-20-19:09:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
68
diff
changeset
|
301 ngx_string(error_502_page), |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
302 ngx_string(error_503_page), |
637 | 303 ngx_string(error_504_page), |
304 ngx_null_string, /* 505 */ | |
305 ngx_null_string, /* 506 */ | |
306 ngx_string(error_507_page) | |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
307 }; |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
308 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
47
diff
changeset
|
309 |
717
08652aae6fab
fix msvc build failure introduced by previous commit
Igor Sysoev <igor@sysoev.ru>
parents:
716
diff
changeset
|
310 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
|
311 |
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
312 |
487 | 313 ngx_int_t |
314 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
|
315 { |
679 | 316 u_char *p; |
317 size_t msie_refresh; | |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
318 uintptr_t escape; |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
233
diff
changeset
|
319 ngx_int_t rc; |
673 | 320 ngx_buf_t *b; |
679 | 321 ngx_str_t *uri, *location; |
681 | 322 ngx_uint_t i, n, err, msie_padding; |
501 | 323 ngx_chain_t *out, *cl; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
324 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
|
325 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
|
326 |
527 | 327 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
328 "http special response: %d, \"%V\"", error, &r->uri); | |
329 | |
1370
cc114c85be0f
rename ngx_http_discard_body() to ngx_http_discard_request_body()
Igor Sysoev <igor@sysoev.ru>
parents:
1353
diff
changeset
|
330 rc = ngx_http_discard_request_body(r); |
161
88abd07d9f62
nginx-0.0.1-2003-10-27-19:16:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
331 |
294
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
332 if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) { |
5cfd65b8b0a7
nginx-0.0.3-2004-03-23-09:01:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
293
diff
changeset
|
333 error = NGX_HTTP_INTERNAL_SERVER_ERROR; |
161
88abd07d9f62
nginx-0.0.1-2003-10-27-19:16:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
334 } |
88abd07d9f62
nginx-0.0.1-2003-10-27-19:16:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
158
diff
changeset
|
335 |
677 | 336 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
|
337 |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
338 if (r->keepalive != 0) { |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
339 switch (error) { |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
340 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
|
341 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
|
342 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
|
343 case NGX_HTTP_TO_HTTPS: |
647 | 344 case NGX_HTTPS_CERT_ERROR: |
345 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
|
346 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
|
347 r->keepalive = 0; |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
348 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
349 } |
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
350 |
88
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
351 if (r->lingering_close == 1) { |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
352 switch (error) { |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
353 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
|
354 case NGX_HTTP_TO_HTTPS: |
647 | 355 case NGX_HTTPS_CERT_ERROR: |
356 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
|
357 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
|
358 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
359 } |
674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
71
diff
changeset
|
360 |
675 | 361 r->headers_out.content_type.len = 0; |
362 | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
363 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
|
364 |
679 | 365 if (!r->error_page && clcf->error_pages) { |
366 | |
367 if (clcf->recursive_error_pages == 0) { | |
368 r->error_page = 1; | |
369 } | |
477 | 370 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
371 err_page = clcf->error_pages->elts; |
477 | 372 |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
373 for (i = 0; i < clcf->error_pages->nelts; i++) { |
477 | 374 |
326
8733703a37f3
nginx-0.0.3-2004-04-26-00:13:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
375 if (err_page[i].status == error) { |
555 | 376 r->err_status = err_page[i].overwrite; |
477 | 377 |
539 | 378 r->method = NGX_HTTP_GET; |
716
d8d7c39e3a76
allowing handling 400 errors via proxy_pass
Igor Sysoev <igor@sysoev.ru>
parents:
681
diff
changeset
|
379 r->method_name = ngx_http_get_name; |
539 | 380 |
673 | 381 uri = &err_page[i].uri; |
382 | |
383 if (err_page[i].uri_lengths) { | |
384 if (ngx_http_script_run(r, uri, | |
385 err_page[i].uri_lengths->elts, 0, | |
386 err_page[i].uri_values->elts) | |
387 == NULL) | |
388 { | |
389 return NGX_ERROR; | |
390 } | |
681 | 391 |
392 if (r->zero_in_uri) { | |
393 for (n = 0; n < uri->len; n++) { | |
394 if (uri->data[n] == '\0') { | |
395 goto zero; | |
396 } | |
397 } | |
398 | |
399 r->zero_in_uri = 0; | |
400 } | |
401 | |
402 } else { | |
403 r->zero_in_uri = 0; | |
673 | 404 } |
405 | |
681 | 406 zero: |
407 | |
673 | 408 if (uri->data[0] == '/') { |
409 return ngx_http_internal_redirect(r, uri, NULL); | |
555 | 410 } |
411 | |
1353 | 412 if (uri->data[0] == '@') { |
413 return ngx_http_named_location(r, uri); | |
414 } | |
415 | |
555 | 416 r->headers_out.location = |
417 ngx_list_push(&r->headers_out.headers); | |
418 | |
419 if (r->headers_out.location) { | |
675 | 420 error = NGX_HTTP_MOVED_TEMPORARILY; |
421 | |
555 | 422 r->err_status = NGX_HTTP_MOVED_TEMPORARILY; |
423 | |
424 r->headers_out.location->hash = 1; | |
425 r->headers_out.location->key.len = sizeof("Location") - 1; | |
426 r->headers_out.location->key.data = (u_char *) "Location"; | |
673 | 427 r->headers_out.location->value = *uri; |
555 | 428 |
429 } else { | |
673 | 430 return NGX_ERROR; |
555 | 431 } |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
432 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
433 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
434 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
435 |
633 | 436 if (error == NGX_HTTP_CREATED) { |
437 /* 201 */ | |
438 err = 0; | |
637 | 439 r->header_only = 1; |
633 | 440 |
441 } else if (error == NGX_HTTP_NO_CONTENT) { | |
511 | 442 /* 204 */ |
443 err = 0; | |
444 | |
445 } else if (error < NGX_HTTP_BAD_REQUEST) { | |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
446 /* 3XX */ |
513 | 447 err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200; |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
448 |
587 | 449 } else if (error < NGX_HTTP_OWN_CODES) { |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
450 /* 4XX */ |
511 | 451 err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_LEVEL_200 |
452 + NGX_HTTP_LEVEL_300; | |
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 |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
454 } else { |
335
d4241d7787fe
nginx-0.0.3-2004-05-14-20:51:47 import
Igor Sysoev <igor@sysoev.ru>
parents:
331
diff
changeset
|
455 /* 49X, 5XX */ |
587 | 456 err = error - NGX_HTTP_OWN_CODES + NGX_HTTP_LEVEL_200 |
511 | 457 + NGX_HTTP_LEVEL_300 |
499 | 458 + NGX_HTTP_LEVEL_400; |
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: | |
679 | 463 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
|
464 error = NGX_HTTP_BAD_REQUEST; |
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 } |
176
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
467 } |
c0552e5ab567
nginx-0.0.1-2003-11-09-23:03:38 import; separate building
Igor Sysoev <igor@sysoev.ru>
parents:
165
diff
changeset
|
468 |
356
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
469 msie_padding = 0; |
2e3cbc1bbe3c
nginx-0.0.7-2004-06-16-19:32:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
470 |
730
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
471 if (!r->zero_body) { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
472 if (error_pages[err].len) { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
473 r->headers_out.content_length_n = error_pages[err].len |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
474 + sizeof(error_tail) - 1; |
331
f168a88e93f7
nginx-0.0.3-2004-05-04-21:56:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
326
diff
changeset
|
475 |
730
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
476 if (clcf->msie_padding |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
477 && r->headers_in.msie |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
478 && r->http_version >= NGX_HTTP_VERSION_10 |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
479 && error >= NGX_HTTP_BAD_REQUEST |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
480 && error != NGX_HTTP_REQUEST_URI_TOO_LARGE) |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
481 { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
482 r->headers_out.content_length_n += |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
483 sizeof(ngx_http_msie_stub) - 1; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
484 msie_padding = 1; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
485 } |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
486 |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
487 r->headers_out.content_type.len = sizeof("text/html") - 1; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
488 r->headers_out.content_type.data = (u_char *) "text/html"; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
489 |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
490 } else { |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
491 r->headers_out.content_length_n = -1; |
331
f168a88e93f7
nginx-0.0.3-2004-05-04-21:56:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
326
diff
changeset
|
492 } |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
493 |
68
d549fdc17d7e
nginx-0.0.1-2003-03-12-20:32:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
67
diff
changeset
|
494 } else { |
730
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
495 r->headers_out.content_length_n = 0; |
1be87cdd010f
set "Content-Length: 0" for errors handled by "return 204"
Igor Sysoev <igor@sysoev.ru>
parents:
717
diff
changeset
|
496 err = 0; |
165
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
497 } |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
498 |
894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
499 if (r->headers_out.content_length) { |
509 | 500 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
|
501 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
|
502 } |
24
77c7629a2627
nginx-0.0.1-2002-12-10-21:05:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
503 |
679 | 504 if (clcf->msie_refresh |
505 && r->headers_in.msie | |
506 && (error == NGX_HTTP_MOVED_PERMANENTLY | |
507 || error == NGX_HTTP_MOVED_TEMPORARILY)) | |
508 { | |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
509 |
679 | 510 location = &r->headers_out.location->value; |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
511 |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
512 escape = 2 * ngx_escape_uri(NULL, location->data, location->len, |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
513 NGX_ESCAPE_REFRESH); |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
514 |
679 | 515 msie_refresh = sizeof(ngx_http_msie_refresh_head) - 1 |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
516 + escape + location->len |
679 | 517 + sizeof(ngx_http_msie_refresh_tail) - 1; |
518 | |
519 r->err_status = NGX_HTTP_OK; | |
520 r->headers_out.content_type_len = sizeof("text/html") - 1; | |
521 r->headers_out.content_length_n = msie_refresh; | |
522 r->headers_out.location->hash = 0; | |
523 r->headers_out.location = NULL; | |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
524 |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
525 } else { |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
526 location = NULL; |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
527 escape = 0; |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
528 msie_refresh = 0; |
679 | 529 } |
530 | |
577 | 531 ngx_http_clear_accept_ranges(r); |
532 ngx_http_clear_last_modified(r); | |
533 | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
534 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
|
535 |
143
5526213be452
nginx-0.0.1-2003-10-10-19:10:50 import
Igor Sysoev <igor@sysoev.ru>
parents:
142
diff
changeset
|
536 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
|
537 return rc; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
538 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
539 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
540 |
679 | 541 if (msie_refresh == 0) { |
501 | 542 |
679 | 543 if (error_pages[err].len == 0) { |
544 return NGX_OK; | |
545 } | |
501 | 546 |
547 b = ngx_calloc_buf(r->pool); | |
548 if (b == NULL) { | |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
549 return NGX_ERROR; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
550 } |
501 | 551 |
343
6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Igor Sysoev <igor@sysoev.ru>
parents:
335
diff
changeset
|
552 b->memory = 1; |
679 | 553 b->pos = error_pages[err].data; |
554 b->last = error_pages[err].data + error_pages[err].len; | |
555 | |
556 cl = ngx_alloc_chain_link(r->pool); | |
557 if (cl == NULL) { | |
558 return NGX_ERROR; | |
559 } | |
560 | |
561 cl->buf = b; | |
562 out = cl; | |
563 | |
564 | |
565 b = ngx_calloc_buf(r->pool); | |
566 if (b == NULL) { | |
567 return NGX_ERROR; | |
568 } | |
569 | |
570 b->memory = 1; | |
571 b->pos = error_tail; | |
572 b->last = error_tail + sizeof(error_tail) - 1; | |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
573 |
501 | 574 cl->next = ngx_alloc_chain_link(r->pool); |
575 if (cl->next == NULL) { | |
576 return NGX_ERROR; | |
577 } | |
578 | |
579 cl = cl->next; | |
580 cl->buf = b; | |
679 | 581 |
582 if (msie_padding) { | |
583 b = ngx_calloc_buf(r->pool); | |
584 if (b == NULL) { | |
585 return NGX_ERROR; | |
586 } | |
587 | |
588 b->memory = 1; | |
589 b->pos = ngx_http_msie_stub; | |
590 b->last = ngx_http_msie_stub + sizeof(ngx_http_msie_stub) - 1; | |
591 | |
592 cl->next = ngx_alloc_chain_link(r->pool); | |
593 if (cl->next == NULL) { | |
594 return NGX_ERROR; | |
595 } | |
596 | |
597 cl = cl->next; | |
598 cl->buf = b; | |
599 } | |
600 | |
601 } else { | |
602 b = ngx_create_temp_buf(r->pool, msie_refresh); | |
603 if (b == NULL) { | |
604 return NGX_ERROR; | |
605 } | |
606 | |
607 p = ngx_cpymem(b->pos, ngx_http_msie_refresh_head, | |
608 sizeof(ngx_http_msie_refresh_head) - 1); | |
609 | |
1298
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
610 if (escape == 0) { |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
611 p = ngx_cpymem(p, location->data, location->len); |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
612 |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
613 } else { |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
614 p = (u_char *) ngx_escape_uri(p, location->data, location->len, |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
615 NGX_ESCAPE_REFRESH); |
458e041fc902
msie_refresh should escape at least '"' to prevent XSS
Igor Sysoev <igor@sysoev.ru>
parents:
1057
diff
changeset
|
616 } |
679 | 617 |
618 b->last = ngx_cpymem(p, ngx_http_msie_refresh_tail, | |
619 sizeof(ngx_http_msie_refresh_tail) - 1); | |
620 | |
621 cl = ngx_alloc_chain_link(r->pool); | |
622 if (cl == NULL) { | |
623 return NGX_ERROR; | |
624 } | |
625 | |
626 cl->buf = b; | |
627 out = cl; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
628 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
629 |
597 | 630 if (r == r->main) { |
509 | 631 b->last_buf = 1; |
632 } | |
633 | |
634 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
|
635 |
501 | 636 cl->next = NULL; |
637 | |
153
c71aeb75c071
nginx-0.0.1-2003-10-21-20:49:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
148
diff
changeset
|
638 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
|
639 } |