comparison src/http/ngx_http_special_response.c @ 578:f3a9e57d2e17

Merge with current.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Mar 2010 21:27:17 +0300
parents e19e5f542878
children 8246d8a2c2be
comparison
equal deleted inserted replaced
539:5f4de8cf0d9d 578:f3a9e57d2e17
29 "</body>" CRLF 29 "</body>" CRLF
30 "</html>" CRLF 30 "</html>" CRLF
31 ; 31 ;
32 32
33 33
34 static u_char ngx_http_msie_stub[] = 34 static u_char ngx_http_msie_padding[] =
35 "<!-- The padding to disable MSIE's friendly error page -->" CRLF 35 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
36 "<!-- The padding to disable MSIE's friendly error page -->" CRLF 36 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
37 "<!-- The padding to disable MSIE's friendly error page -->" CRLF 37 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
38 "<!-- The padding to disable MSIE's friendly error page -->" CRLF 38 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
39 "<!-- The padding to disable MSIE's friendly error page -->" CRLF 39 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
40 "<!-- The padding to disable MSIE's friendly error page -->" CRLF 40 "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
41 ; 41 ;
42 42
43 43
44 static u_char ngx_http_msie_refresh_head[] = 44 static u_char ngx_http_msie_refresh_head[] =
45 "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL="; 45 "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=";
596 if (!r->zero_body) { 596 if (!r->zero_body) {
597 if (ngx_http_error_pages[err].len) { 597 if (ngx_http_error_pages[err].len) {
598 r->headers_out.content_length_n = ngx_http_error_pages[err].len 598 r->headers_out.content_length_n = ngx_http_error_pages[err].len
599 + len; 599 + len;
600 if (clcf->msie_padding 600 if (clcf->msie_padding
601 && r->headers_in.msie 601 && (r->headers_in.msie || r->headers_in.chrome)
602 && r->http_version >= NGX_HTTP_VERSION_10 602 && r->http_version >= NGX_HTTP_VERSION_10
603 && err >= NGX_HTTP_LEVEL_300) 603 && err >= NGX_HTTP_LEVEL_300)
604 { 604 {
605 r->headers_out.content_length_n += 605 r->headers_out.content_length_n +=
606 sizeof(ngx_http_msie_stub) - 1; 606 sizeof(ngx_http_msie_padding) - 1;
607 msie_padding = 1; 607 msie_padding = 1;
608 } 608 }
609 609
610 r->headers_out.content_type_len = sizeof("text/html") - 1; 610 r->headers_out.content_type_len = sizeof("text/html") - 1;
611 r->headers_out.content_type.len = sizeof("text/html") - 1; 611 r->headers_out.content_type.len = sizeof("text/html") - 1;
669 if (b == NULL) { 669 if (b == NULL) {
670 return NGX_ERROR; 670 return NGX_ERROR;
671 } 671 }
672 672
673 b->memory = 1; 673 b->memory = 1;
674 b->pos = ngx_http_msie_stub; 674 b->pos = ngx_http_msie_padding;
675 b->last = ngx_http_msie_stub + sizeof(ngx_http_msie_stub) - 1; 675 b->last = ngx_http_msie_padding + sizeof(ngx_http_msie_padding) - 1;
676 676
677 out[1].next = &out[2]; 677 out[1].next = &out[2];
678 out[2].buf = b; 678 out[2].buf = b;
679 out[2].next = NULL; 679 out[2].next = NULL;
680 } 680 }