chiark / gitweb /
journal-gatewayd: return nice error on unsupported methods
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Jan 2013 06:53:01 +0000 (01:53 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 18 Jan 2013 06:16:30 +0000 (01:16 -0500)
Returns "HTTP/1.0 406 Not Acceptable" instead of silently
closing the connection.

src/journal/journal-gatewayd.c

index 23939ccbca9bcd7e2a2fc90455ebf7bf5ae3ccf4..4a4905dbfb8b94dd4498879c1e8d104b340269fd 100644 (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))