From: Sascha Schumann Date: Thu, 2 Nov 2000 21:31:37 +0000 (+0000) Subject: Fix last commit which was done from the wrong tree which contained X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8dbcb039c061819b8906a779900620b770d82ea6;p=apache Fix last commit which was done from the wrong tree which contained 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 --- diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 20b87bf148..5e698cbbe1 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -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; }