Let the frontend deal with bad requests for posting to member resources
[cascardo/atompub.git] / frontend / cgi / cgi.c
index 20f1ce7..0719175 100644 (file)
@@ -136,7 +136,17 @@ cgi_get_request (AtomCtx *ctx)
       return NULL;
     }
   if (path == NULL || *path == '\0')
-    path = "/";
+    {
+      if (!strcmp (method, "POST"))
+        {
+          error = atom_error_new ();
+          atom_error_code_set (error, 400);
+          atom_error_message_set (error, "Bad Request");
+          atom_error_set (ctx, error);
+          return NULL;
+        }
+      path = "/";
+    }
   if (!strcmp (method, "GET"))
     {
       /* Remove the leading slash before mapping */