Skip to content

Commit

Permalink
Get correct request method.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 31, 2008
1 parent 0112528 commit fb4eefe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nph-offload.c
Expand Up @@ -870,7 +870,12 @@ int main(int argc, char **argv, char **envp)
if (strcmp(Guri, "/robots.txt") == 0)
failure("200 OK", "User-agent: *\nDisallow: /");

const char *reqmethod = getenv("REQUEST_METHOD");
const char *reqmethod = getenv("REDIRECT_REQUEST_METHOD");
if (reqmethod == NULL)
reqmethod = getenv("REQUEST_METHOD");
if (reqmethod == NULL)
reqmethod = "GET";

const int isget = (strcasecmp(reqmethod, "GET") == 0);
const int ishead = (strcasecmp(reqmethod, "HEAD") == 0);
if ( (strchr(Guri, '?') != NULL) || ((!isget) && (!ishead)) )
Expand Down

0 comments on commit fb4eefe

Please sign in to comment.