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