SSI forwards request method

I’ve noticed that when using server side includes, the original
document’s
request method is used for the includes of the subsequent documents.
I would think that includes should be GET requests, regardless of the
original document’s request method (you can’t add POST or PUT variables
in
the include statements, after all.)
Should that be changed to always use GET?

Regardless, is it possible to change the request method from the Nginx
side?

Redefining $request_method as follows seems to be disallowed:

set $request_method GET;

Compile message:

2008/01/08 15:05:48 [emerg] 32758#0: the duplicate “request_method”

variable in /usr/local/nginx/conf/nginx.conf:159

On Tue, Jan 08, 2008 at 03:50:07PM -0500, Larrytheliquid wrote:

set $request_method GET;

Compile message:

2008/01/08 15:05:48 [emerg] 32758#0: the duplicate “request_method”

variable in /usr/local/nginx/conf/nginx.conf:159

nginx uses GET in subrequests, however, this functionality is not
complete.
The atached patch should fix the bug.

Thank you Igor. Which version is that patch targeted at?

I tried 0.5.35 and it wouldn’t accept the patch:
/usr/local/src/nginx-0.5.34 # patch -p0 < /root/patch-subrequest
patching file src/http/ngx_http_core_module.c
Hunk #1 FAILED at 113.
Hunk #2 succeeded at 1427 (offset -336 lines).
1 out of 2 hunks FAILED – saving rejects to file
src/http/ngx_http_core_module.c.rej

0.6.25 accepted the patch I but got compile errors:
cc1: warnings being treated as errors
src/http/ngx_http_core_module.c:116: warning: pointer targets in
initialization differ in signedness
make[1]: *** [objs/src/http/ngx_http_core_module.o] Error 1
make[1]: Leaving directory `/usr/local/src/nginx-0.6.25’
make: *** [build] Error 2

On Wed, Jan 09, 2008 at 10:07:11AM -0500, Larrytheliquid wrote:

Thank you Igor. Which version is that patch targeted at?

I tried 0.5.35 and it wouldn’t accept the patch:
/usr/local/src/nginx-0.5.34 # patch -p0 < /root/patch-subrequest
patching file src/http/ngx_http_core_module.c
Hunk #1 FAILED at 113.
Hunk #2 succeeded at 1427 (offset -336 lines).
1 out of 2 hunks FAILED – saving rejects to file
src/http/ngx_http_core_module.c.rej

The attached patch is against 0.5.35.

0.6.25 accepted the patch I but got compile errors:
cc1: warnings being treated as errors
src/http/ngx_http_core_module.c:116: warning: pointer targets in
initialization differ in signedness
make[1]: *** [objs/src/http/ngx_http_core_module.o] Error 1
make[1]: Leaving directory `/usr/local/src/nginx-0.6.25’
make: *** [build] Error 2

I did not test it under gcc 4.2. It should be

-static ngx_str_t ngx_http_core_get_method = { 3, "GET " };
+static ngx_str_t ngx_http_core_get_method = { 3, (u_char *) "GET " };