resources: reject non-HEAD non-GET requests

This commit is contained in:
Jeff Kaufman
2013-01-21 13:48:32 -05:00
parent 76ef7f9f47
commit 8fcea5c873
+4 -2
View File
@@ -1440,14 +1440,16 @@ ps_static_handler(ngx_http_request_t* r) {
// and for static content like /ngx_pagespeed_static/js_defer.q1EBmcgYOC.js
ngx_int_t
ps_content_handler(ngx_http_request_t* r) {
if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
return NGX_DECLINED;
}
ps_srv_conf_t* cfg_s = ps_get_srv_config(r);
if (cfg_s->server_context == NULL) {
// Pagespeed is on for some server block but not this one.
return NGX_DECLINED;
}
// TODO(jefftk): return NGX_DECLINED for non-get non-head requests.
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http pagespeed handler \"%V\"", &r->uri);