MCPcopy Index your code
hub / github.com/git/git / bad_request

Function bad_request

http-backend.c:749–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

747};
748
749static int bad_request(struct strbuf *hdr, const struct service_cmd *c)
750{
751 const char *proto = getenv("SERVER_PROTOCOL");
752
753 if (proto && !strcmp(proto, "HTTP/1.1")) {
754 http_status(hdr, 405, "Method Not Allowed");
755 hdr_str(hdr, "Allow",
756 !strcmp(c->method, "GET") ? "GET, HEAD" : c->method);
757 } else
758 http_status(hdr, 400, "Bad Request");
759 hdr_nocache(hdr);
760 end_headers(hdr);
761 return 0;
762}
763
764int cmd_main(int argc UNUSED, const char **argv UNUSED)
765{

Callers 1

cmd_mainFunction · 0.85

Calls 4

http_statusFunction · 0.85
hdr_strFunction · 0.85
hdr_nocacheFunction · 0.85
end_headersFunction · 0.85

Tested by

no test coverage detected