diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-08-06 13:18:57 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-08-06 13:18:57 +0000 |
commit | f98f98610e59d36f0e4f1c6e64df12c965cc92d8 (patch) | |
tree | 98d6175748de0bac7c07564e24be74ca9a4f567a /src | |
parent | f36ae41e3689e8347364e10335ddbf09b9103ca8 (diff) | |
download | nginx-f98f98610e59d36f0e4f1c6e64df12c965cc92d8.tar.gz nginx-f98f98610e59d36f0e4f1c6e64df12c965cc92d8.zip |
clear Last-Modified; set content-type and length for main request only
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_xslt_filter_module.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/http/modules/ngx_http_xslt_filter_module.c b/src/http/modules/ngx_http_xslt_filter_module.c index 6b8ee0ad8..5ab59d4a1 100644 --- a/src/http/modules/ngx_http_xslt_filter_module.c +++ b/src/http/modules/ngx_http_xslt_filter_module.c @@ -332,11 +332,15 @@ ngx_http_xslt_send(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx, NGX_HTTP_INTERNAL_SERVER_ERROR); } - r->headers_out.content_length_n = b->last - b->pos; + if (r == r->main) { + r->headers_out.content_length_n = b->last - b->pos; - if (r->headers_out.content_length) { - r->headers_out.content_length->hash = 0; - r->headers_out.content_length = NULL; + if (r->headers_out.content_length) { + r->headers_out.content_length->hash = 0; + r->headers_out.content_length = NULL; + } + + ngx_http_clear_last_modified(r); } rc = ngx_http_next_header_filter(r); @@ -785,7 +789,13 @@ ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r, /* there must be at least one stylesheet */ - type = ngx_http_xslt_content_type(sheet[i - 1].stylesheet); + if (r == r->main) { + type = ngx_http_xslt_content_type(sheet[i - 1].stylesheet); + + } else { + type = NULL; + } + encoding = ngx_http_xslt_encoding(sheet[i - 1].stylesheet); doc_type = doc->type; @@ -821,6 +831,15 @@ ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r, b->memory = 1; b->last_buf = 1; + if (encoding) { + r->headers_out.charset.len = ngx_strlen(encoding); + r->headers_out.charset.data = encoding; + } + + if (r != r->main) { + return b; + } + if (type) { len = ngx_strlen(type); @@ -835,11 +854,6 @@ ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r, r->headers_out.content_type.data = (u_char *) "text/html"; } - if (encoding) { - r->headers_out.charset.len = ngx_strlen(encoding); - r->headers_out.charset.data = encoding; - } - return b; } |