Browse Source

Merge branch 'bc/http-backend-allow-405' into maint

* bc/http-backend-allow-405:
  http-backend: provide Allow header for 405
maint
Junio C Hamano 11 years ago
parent
commit
968792eeeb
  1. 6
      http-backend.c

6
http-backend.c

@ -594,9 +594,11 @@ int main(int argc, char **argv) @@ -594,9 +594,11 @@ int main(int argc, char **argv)

if (strcmp(method, c->method)) {
const char *proto = getenv("SERVER_PROTOCOL");
if (proto && !strcmp(proto, "HTTP/1.1"))
if (proto && !strcmp(proto, "HTTP/1.1")) {
http_status(405, "Method Not Allowed");
else
hdr_str("Allow", !strcmp(c->method, "GET") ?
"GET, HEAD" : c->method);
} else
http_status(400, "Bad Request");
hdr_nocache();
end_headers();

Loading…
Cancel
Save