callcgi: Fixed PATH_INFO bug.
authorFredrik Tolf <fredrik@dolda2000.com>
Tue, 31 Aug 2010 22:20:28 +0000 (00:20 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Tue, 31 Aug 2010 22:20:28 +0000 (00:20 +0200)
src/callcgi.c

index 10bb87c..fb2596b 100644 (file)
@@ -90,7 +90,10 @@ static void forkchild(int inpath, char *prog, char *file, char *method, char *ur
        if(getenv("HTTP_VERSION"))
            putenv(sprintf2("SERVER_PROTOCOL=%s", getenv("HTTP_VERSION")));
        putenv(sprintf2("REQUEST_METHOD=%s", method));
-       putenv(sprintf2("PATH_INFO=/%s", rest));
+       if(*rest)
+           putenv(sprintf2("PATH_INFO=/%s", rest));
+       else
+           putenv("PATH_INFO=");
        name = url;
        /* XXX: This is an ugly hack (I think), but though I can think
         * of several alternatives, none seem to be better. */