Welcome! Log In Create A New Profile

Advanced

Is calling ngx_http_discard_request_body() still necessary in modules only handle HTTP GETs ?

July 24, 2014 10:09AM
Hi all:

In nginx's native memcached module, I found that ngx_http_discard_request_body() was called right after a statement that only allow GET/HEAD requests to pass through.

For ref: src/http/modules/ngx_http_memcached_module.c


if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
return NGX_HTTP_NOT_ALLOWED;
}

rc = ngx_http_discard_request_body(r);


However, in other places, such as (ngx_http_empty_gif_module) ,that ngx_http_discard_request_body() function call was just missed. Usually HTTP GET reqeust should not have request body. So, what's the point of having ngx_http_discard_request_body() in memcached module? and which pattern should I use?




Regard
YM
Subject Author Posted

Is calling ngx_http_discard_request_body() still necessary in modules only handle HTTP GETs ?

gzchenym July 24, 2014 10:09AM

Re: Is calling ngx_http_discard_request_body() still necessary in modules only handle HTTP GETs ?

Maxim Dounin July 24, 2014 02:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 91
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready