Mercurial > hg > nginx
comparison src/http/modules/ngx_http_charset_filter_module.c @ 2891:76dfc19dcd49
do not set charset for subrequests
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 26 May 2009 09:38:48 +0000 |
parents | a4302032b831 |
children | c7d57b539248 |
comparison
equal
deleted
inserted
replaced
2890:a4302032b831 | 2891:76dfc19dcd49 |
---|---|
250 | 250 |
251 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 251 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
252 "charset: \"%V\" > \"%V\"", &src, &dst); | 252 "charset: \"%V\" > \"%V\"", &src, &dst); |
253 | 253 |
254 if (source_charset == NGX_HTTP_CHARSET_OFF) { | 254 if (source_charset == NGX_HTTP_CHARSET_OFF) { |
255 | 255 ngx_http_set_charset(r, &dst); |
256 if (r == r->main) { | |
257 ngx_http_set_charset(r, &dst); | |
258 } | |
259 | 256 |
260 return ngx_http_next_header_filter(r); | 257 return ngx_http_next_header_filter(r); |
261 } | 258 } |
262 | 259 |
263 if (charset == NGX_HTTP_NO_CHARSET | 260 if (charset == NGX_HTTP_NO_CHARSET |
486 | 483 |
487 | 484 |
488 static ngx_inline void | 485 static ngx_inline void |
489 ngx_http_set_charset(ngx_http_request_t *r, ngx_str_t *charset) | 486 ngx_http_set_charset(ngx_http_request_t *r, ngx_str_t *charset) |
490 { | 487 { |
488 if (r != r->main) { | |
489 return; | |
490 } | |
491 | |
491 if (r->headers_out.status == NGX_HTTP_MOVED_PERMANENTLY | 492 if (r->headers_out.status == NGX_HTTP_MOVED_PERMANENTLY |
492 || r->headers_out.status == NGX_HTTP_MOVED_TEMPORARILY) | 493 || r->headers_out.status == NGX_HTTP_MOVED_TEMPORARILY) |
493 { | 494 { |
494 /* | 495 /* |
495 * do not set charset for the redirect because NN 4.x | 496 * do not set charset for the redirect because NN 4.x |