X-Git-Url: http://git.scripts.mit.edu/?a=blobdiff_plain;f=http-backend.c;h=8c464bd8051ed813175b01f832e5e78a91bba8ea;hb=c536c0755f6450b7bcce499cfda171f8c6d1e593;hp=03244172977ba44399383c5b22f90877c94da964;hpb=f8aeacfa1f1e7b1f2d7b0c5fbb7becbbc6248183;p=git.git 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();