From 9a38d2654f6b1c704ec9ab82a4d91cbef7767a48 Mon Sep 17 00:00:00 2001 From: Henrik Friedrichsen Date: Mon, 18 May 2015 19:47:57 +0200 Subject: correctly set PATH_INFO environment variable according to RFC 3875 PATH_INFO should either contain a full path or be empty. --- httpd/server_fcgi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/httpd/server_fcgi.c b/httpd/server_fcgi.c index d0a8800..b627dc3 100644 --- a/httpd/server_fcgi.c +++ b/httpd/server_fcgi.c @@ -210,6 +210,13 @@ server_fcgi(struct httpd *env, struct client *clt) } script[scriptlen] = '\0'; } + else { + if (fcgi_add_param(¶m, "PATH_INFO", "", clt) == -1) { + errstr = "failed to encode param"; + goto fail; + } + } + /* * calculate length of http SCRIPT_NAME: -- cgit v1.2.3-54-g00ecf From f5403fc57b13b2e66acac3980d9a4870114685af Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Fri, 17 Jul 2015 22:32:23 +0200 Subject: Add clarification, RFC 3875 --- httpd/server_fcgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpd/server_fcgi.c b/httpd/server_fcgi.c index ce0ccc8..79f382b 100644 --- a/httpd/server_fcgi.c +++ b/httpd/server_fcgi.c @@ -212,8 +212,8 @@ server_fcgi(struct httpd *env, struct client *clt) goto fail; } script[scriptlen] = '\0'; - } - else { + } else { + /* RFC 3875 mandates that PATH_INFO is empty if not set */ if (fcgi_add_param(¶m, "PATH_INFO", "", clt) == -1) { errstr = "failed to encode param"; goto fail; -- cgit v1.2.3-54-g00ecf