Skip to content

Commit

Permalink
fixed gzip subscriber clearing etag bug
Browse files Browse the repository at this point in the history
  • Loading branch information
slact committed Aug 15, 2014
1 parent 244629b commit 4089ecc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

fix: turning on gzip cleared Etag subscriber response header
fix: channels incorrectly deleted when overwhelmed with connections
feature: CORS support via OPTIONS request method response
fix: file descriptor leak when restarting nginx via SIGHUP
Expand Down
4 changes: 2 additions & 2 deletions src/ngx_http_push_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ ngx_int_t ngx_http_push_prepare_response_to_subscriber_request(ngx_http_request_
}
if(etag!=NULL) {
//etag, if we need one
if ((r->headers_out.etag=ngx_http_push_add_response_header(r, &NGX_HTTP_PUSH_HEADER_ETAG, etag))==NULL) {
if ((ngx_http_push_add_response_header(r, &NGX_HTTP_PUSH_HEADER_ETAG, etag))==NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
}
Expand Down Expand Up @@ -539,7 +539,7 @@ ngx_int_t ngx_http_push_subscriber_handler(ngx_http_request_t *r) {
r->headers_out.last_modified_time=ngx_http_parse_time(r->headers_in.if_modified_since->value.data, r->headers_in.if_modified_since->value.len);
}
if ((etag=ngx_http_push_subscriber_get_etag(r)) != NULL) {
r->headers_out.etag=ngx_http_push_add_response_header(r, &NGX_HTTP_PUSH_HEADER_ETAG, etag);
ngx_http_push_add_response_header(r, &NGX_HTTP_PUSH_HEADER_ETAG, etag);
}
return NGX_HTTP_NOT_MODIFIED;

Expand Down
1 change: 1 addition & 0 deletions tests/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def test_options
end

def test_gzip
#bug: turning on gzip cleared the response etag
pub, sub = pubsub 1, sub: "/sub/gzip/", gzip: true, retry_delay: 0.3
sub.run
pub.post ["2", "123456789A", "alsdjklsdhflsajkfhl", "boq"]
Expand Down

0 comments on commit 4089ecc

Please sign in to comment.