journal-gatewayd: return nice error on unsupported methods

Returns "HTTP/1.0 406 Not Acceptable" instead of silently
closing the connection.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-01-17 01:53:01 -05:00
parent 8530a1436a
commit a93035cee3

View File

@ -834,7 +834,9 @@ static int request_handler(
assert(method);
if (!streq(method, "GET"))
return MHD_NO;
return respond_error(connection, MHD_HTTP_METHOD_NOT_ACCEPTABLE,
"Unsupported method.\n");
if (!*connection_cls) {
if (!request_meta(connection_cls))