Mercurial > hg > nginx-quic
comparison src/http/ngx_http_special_response.c @ 3573:5d9ff79eab6f stable-0.7
merge r3316, r3317, r3420, r3421, r3453:
browsers related fixes:
*) add MSIE padding for Chrome too
*) disable keepalive for Safari:
https://bugs.webkit.org/show_bug.cgi?id=5760
*) do not disable keepalive after POST requests for MSIE 7+
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 04 Jun 2010 17:47:04 +0000 |
parents | 896db5a09bd2 |
children | dd1570b6f237 8152369f7037 |
comparison
equal
deleted
inserted
replaced
3572:b7c4d96cd61c | 3573:5d9ff79eab6f |
---|---|
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 } |