]> granicus.if.org Git - apache/commitdiff
Fix last commit which was done from the wrong tree which contained
authorSascha Schumann <sascha@apache.org>
Thu, 2 Nov 2000 21:31:37 +0000 (21:31 +0000)
committerSascha Schumann <sascha@apache.org>
Thu, 2 Nov 2000 21:31:37 +0000 (21:31 +0000)
an incomplete version of the default_handler change.

This version gets always rid of the request body, regardless of the
method.

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

modules/http/http_core.c

index 20b87bf1489509ddfe9fd4b1e649c128daac8726..5e698cbbe1a8a00d2e690542f821f1ee57622130 100644 (file)
@@ -2951,8 +2951,16 @@ static int default_handler(request_rec *r)
     int bld_content_md5 = 
         (d->content_md5 & 1) && r->output_filters->frec->ftype != AP_FTYPE_CONTENT;
 
-    ap_allow_methods(r, MERGE_ALLOW, "GET", "OPTIONS", NULL);
+    ap_allow_methods(r, MERGE_ALLOW, "GET", "OPTIONS", "POST", NULL);
 
+    if (r->method_number == M_POST) {
+        if ((errstatus = handle_request_body(r)) != APR_SUCCESS) {
+            return errstatus;
+        }
+    } else if ((errstatus = ap_discard_request_body(r)) != OK) {
+        return errstatus;
+    }
+    
     if (r->method_number == M_INVALID) {
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                    "Invalid method in request %s", r->the_request);
@@ -2971,13 +2979,8 @@ static int default_handler(request_rec *r)
                      : r->filename);
        return HTTP_NOT_FOUND;
     }
-    if (r->method_number == M_POST) {
-        if ((errstatus = handle_request_body(r)) != APR_SUCCESS) {
-            return errstatus;
-        }
-    } else if ((errstatus = ap_discard_request_body(r)) != OK) {
-        return errstatus;
-    } else if (r->method_number != M_GET) {
+    
+    if (r->method_number != M_GET && r->method_number != M_POST) {
         return HTTP_METHOD_NOT_ALLOWED;
     }