comparison src/http/ngx_http_header_filter_module.c @ 66:818201e5a553 NGINX_0_1_33

nginx 0.1.33 *) Bugfix: nginx could not be built with the --without-pcre parameter; bug appeared in 0.1.29. *) Bugfix: 3, 4, 7, and 8 the "proxy_set_header" directives in one level cause the bus fault on start up. *) Bugfix: the HTTP protocol was specified in the HTTPS redirects. *) Bugfix: if the "rewrite" directive used the captures inside the "if" directive, then the 500 error code was returned.
author Igor Sysoev <http://sysoev.ru>
date Mon, 23 May 2005 00:00:00 +0400
parents df7d3fff122b
children 8ad297c88dcb
comparison
equal deleted inserted replaced
65:5d92e3f1fb4e 66:818201e5a553
262 && r->headers_out.location->value.len 262 && r->headers_out.location->value.len
263 && r->headers_out.location->value.data[0] == '/') 263 && r->headers_out.location->value.data[0] == '/')
264 { 264 {
265 r->headers_out.location->hash = 0; 265 r->headers_out.location->hash = 0;
266 266
267 len += sizeof("Location: http://") - 1 267 #if (NGX_HTTP_SSL)
268 + r->server_name.len + r->headers_out.location->value.len + 2; 268 if (r->connection->ssl) {
269 269 len += sizeof("Location: https://") - 1
270 if (r->port != 80) { 270 + r->server_name.len
271 len += r->port_text->len; 271 + r->headers_out.location->value.len + 2;
272
273 if (r->port != 443) {
274 len += r->port_text->len;
275 }
276
277 } else
278 #endif
279 {
280 len += sizeof("Location: http://") - 1
281 + r->server_name.len
282 + r->headers_out.location->value.len + 2;
283
284 if (r->port != 80) {
285 len += r->port_text->len;
286 }
272 } 287 }
273 } 288 }
274 289
275 if (r->chunked) { 290 if (r->chunked) {
276 len += sizeof("Transfer-Encoding: chunked" CRLF) - 1; 291 len += sizeof("Transfer-Encoding: chunked" CRLF) - 1;
394 if (r->headers_out.location 409 if (r->headers_out.location
395 && r->headers_out.location->value.len 410 && r->headers_out.location->value.len
396 && r->headers_out.location->value.data[0] == '/') 411 && r->headers_out.location->value.data[0] == '/')
397 { 412 {
398 p = b->last + sizeof("Location: ") - 1; 413 p = b->last + sizeof("Location: ") - 1;
399 b->last = ngx_cpymem(b->last, "Location: http://", 414
400 sizeof("Location: http://") - 1); 415 b->last = ngx_cpymem(b->last, "Location: http",
416 sizeof("Location: http") - 1);
417
418 #if (NGX_HTTP_SSL)
419 if (r->connection->ssl) {
420 *b->last++ ='s';
421 }
422 #endif
423
424 *b->last++ = ':'; *b->last++ = '/'; *b->last++ = '/';
401 b->last = ngx_cpymem(b->last, r->server_name.data, 425 b->last = ngx_cpymem(b->last, r->server_name.data,
402 r->server_name.len); 426 r->server_name.len);
403 if (r->port != 80) { 427
404 b->last = ngx_cpymem(b->last, r->port_text->data, 428 #if (NGX_HTTP_SSL)
405 r->port_text->len); 429 if (r->connection->ssl) {
430 if (r->port != 443) {
431 b->last = ngx_cpymem(b->last, r->port_text->data,
432 r->port_text->len);
433 }
434 } else
435 #endif
436 {
437 if (r->port != 80) {
438 b->last = ngx_cpymem(b->last, r->port_text->data,
439 r->port_text->len);
440 }
406 } 441 }
407 442
408 b->last = ngx_cpymem(b->last, r->headers_out.location->value.data, 443 b->last = ngx_cpymem(b->last, r->headers_out.location->value.data,
409 r->headers_out.location->value.len); 444 r->headers_out.location->value.len);
410 445