Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'bc/http-backend-allow-405' into maint
author
Junio C Hamano
<gitster@pobox.com>
Thu, 17 Oct 2013 22:46:00 +0000
(15:46 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 17 Oct 2013 22:46:00 +0000
(15:46 -0700)
* bc/http-backend-allow-405:
http-backend: provide Allow header for 405
http-backend.c
patch
|
blob
|
history
raw
(from parent 1:
da39d5e
)
diff --git
a/http-backend.c
b/http-backend.c
index 03244172977ba44399383c5b22f90877c94da964..8c464bd8051ed813175b01f832e5e78a91bba8ea 100644
(file)
--- 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();