From: Greg Stein Date: Tue, 1 Oct 2002 16:24:41 +0000 (+0000) Subject: Fix bug in the default handler. POST is not allowed on regular files. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47617c4fc099860dd79475fc77e78966a01854ec;p=apache Fix bug in the default handler. POST is not allowed on regular files. 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 --- diff --git a/server/core.c b/server/core.c index 1d49f656ae..1ba7d71ad2 100644 --- a/server/core.c +++ b/server/core.c @@ -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,