Setting or clearing request->args

Igor Sysoev is at rambler-co.ru
Tue Sep 22 13:46:51 MSD 2009


On Tue, Sep 22, 2009 at 04:21:51AM -0400, leki75 wrote:

> Hello,
> 
> I try to write a nginx http module which decides to enable or forbid a HTTP request sent in the request parameters (r->args). At the end of decision I would like to clear the whole args or just a part of it, so won't appear in access.log of the origin server.
> 
> Is this solution correct without freeing args before?
> 
> static ngx_int_t
> ngx_http_leki_test_handler(ngx_http_request_t *r)
> {
> ...
>     r->args.len  = 0;
>     r->args.data = NULL;
>     ngx_log_error(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "OK", 0);
>     return NGX_OK;
> }

Yes.

> Config example:
> ...
> location / {
>     leki_test on;
>     http://test;
> }
> ...
> 
> Thanks in advance,
>     Leki
> 
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,8327,8327#msg-8327


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list