Welcome! Log In Create A New Profile

Advanced

Re: Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Maxim Dounin
August 30, 2010 03:02PM
Hello!

On Mon, Aug 30, 2010 at 06:31:13PM +0200, Mirko Dziadzka wrote:

> Hi all
>
> I'm using nginx-0.7.66 and am trying to create a POST sub-request:
>
> res = ngx_http_subrequest(r, uri, NULL , &sr, psr, flags);
> sr->method = NGX_HTTP_POST;
> sr->method_name.data = (u_char *)"POST";
> sr->method_name.len = 4;
>
> The uri is then forwarded via proxy_pass to another server.
>
> With wireshark, I see the following bytes on the network:
>
> 00000000 50 4f 53 54 00 2f 64 65 63 69 64 65 2e 63 67 69 POST./de
>
> Please note the 00-byte after the POST. If I change the code to
>
> res = ngx_http_subrequest(r, uri, NULL , &sr, psr, flags);
> sr->method = NGX_HTTP_POST;
> sr->method_name.data = (u_char *)"POST "; // note the SPACE after POST
> sr->method_name.len = 4;
>
> it will work as expected and I see a space. I did not dig further into
> nginx code but it looks like the 5-th byte from "POST" is used in the
> new request - which is probably a bug.

r->method_name expected to point into request line, and the use of
the following byte is intentional.

Maxim Dounin

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Mirko Dziadzka 1858 August 30, 2010 12:32PM

Re: Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Maxim Dounin 690 August 30, 2010 03:02PM

Re: Strange behavior (BUG?) for setting r->headers_in.method_name in a subrequest

Mirko Dziadzka 551 August 31, 2010 04:00AM

Re: Strange behavior (BUG?) for setting r->headers_in.method_namein a subrequest

Piotr Sikora 822 August 31, 2010 04:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 72
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