From: Zbigniew Jędrzejewski-Szmek Date: Thu, 17 Jan 2013 06:53:01 +0000 (-0500) Subject: journal-gatewayd: return nice error on unsupported methods X-Git-Tag: v198~476 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=a93035cee3df135b72b8ff6c1d8361e2e647ed0b journal-gatewayd: return nice error on unsupported methods Returns "HTTP/1.0 406 Not Acceptable" instead of silently closing the connection. --- diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c index 23939ccbc..4a4905dbf 100644 --- a/src/journal/journal-gatewayd.c +++ b/src/journal/journal-gatewayd.c @@ -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))