-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 'Vary' header #98
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,15 +162,15 @@ static ngx_int_t handler(ngx_http_request_t* req) { | |
|
||
/* Get configuration and check if module is disabled. */ | ||
cfg = ngx_http_get_module_loc_conf(req, ngx_http_brotli_static_module); | ||
if (cfg->enable == NGX_HTTP_BROTLI_STATIC_OFF) return NGX_DECLINED; | ||
if (cfg->enable == NGX_HTTP_BROTLI_STATIC_OFF) { | ||
return NGX_DECLINED; | ||
} | ||
|
||
if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ALWAYS) { | ||
/* Ignore request properties (e.g. Accept-Encoding). */ | ||
} else { | ||
/* NGX_HTTP_BROTLI_STATIC_ON */ | ||
req->gzip_vary = 1; | ||
if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ON) { | ||
rc = check_eligility(req); | ||
if (rc != NGX_OK) return NGX_DECLINED; | ||
} else { | ||
/* always */ | ||
} | ||
|
||
/* Get path and append the suffix. */ | ||
|
@@ -227,6 +227,14 @@ static ngx_int_t handler(ngx_http_request_t* req) { | |
return NGX_DECLINED; | ||
} | ||
|
||
if (cfg->enable == NGX_HTTP_BROTLI_STATIC_ON) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if this should be conditional here. |
||
req->gzip_vary = 1; | ||
|
||
if (rc != NGX_OK) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rc can not be != NGX_OK here |
||
return NGX_DECLINED; | ||
} | ||
} | ||
|
||
/* So far so good. */ | ||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", | ||
file_info.fd); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is preferrable to have least-modification concise change. Just remove
req->gzip_vary = 1
line