summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-10-17 15:46:00 -0700
committerJunio C Hamano <gitster@pobox.com>2013-10-17 15:46:00 -0700
commit968792eeeb51be4ff3218c89af00a987cdea8a9a (patch)
treeda656febc92199dda99af6fb3a6bd17754b3328f
parentda39d5e0bceaea51851658c0ed3ff0097b00ee0f (diff)
parent9247be05cf686dc98dd504f8f9fb0f07da1a29d1 (diff)
downloadgit-968792eeeb51be4ff3218c89af00a987cdea8a9a.tar.gz
Merge branch 'bc/http-backend-allow-405' into maint
* bc/http-backend-allow-405: http-backend: provide Allow header for 405
-rw-r--r--http-backend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/http-backend.c b/http-backend.c
index 0324417297..8c464bd805 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -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();