]> granicus.if.org Git - apache/commitdiff
Fix bug in the default handler. POST is not allowed on regular files.
authorGreg Stein <gstein@apache.org>
Tue, 1 Oct 2002 16:24:41 +0000 (16:24 +0000)
committerGreg Stein <gstein@apache.org>
Tue, 1 Oct 2002 16:24:41 +0000 (16:24 +0000)
The resource must be handled by something *other* than the default
handler.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97046 13f79535-47bb-0310-9956-ffa450edef68

server/core.c

index 1d49f656ae3caa24cef32b491d39516a61f318a0..1ba7d71ad2e6b1e62d1f41a1eb71cdbe117f0d9d 100644 (file)
@@ -3259,6 +3259,14 @@ static int default_handler(request_rec *r)
             return HTTP_NOT_FOUND;
         }
 
+        /* we understood the POST method, but it isn't legal for this
+           particular resource. */
+        if (r->method_number == M_POST) {
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                          "This resource does not accept the POST method.");
+            return HTTP_METHOD_NOT_ALLOWED;
+        }
+
         if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0,
                                     r->pool)) != APR_SUCCESS) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,