httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: [BUG]: "Status: 405 instead of 404 when POSTing to bad URL" on HPUX (fwd)
Date Thu, 13 Mar 1997 19:43:44 GMT
On Thu, 13 Mar 1997, Rob Hartill wrote:

> Is this a bug or a feature?. I might consider it a feature considering
> all the URL rewriting that's possible. Presumably it's the directory/path
> that's rejecting the POST.

Feature, defenitely. I mean, the nature of POST is that you could use
it (like PUT) to apply to a non-existant file. Returning a 405 is an
indication that the server doesn't know what it's doing, and can't
handle a POST to that URL.

I think the mistake here is to assume that POST must be to a CGI
script or somesuch. I could envision a module that took POST requests
and archived them in a file, which it might create if it didn't
exist. This requires that method abilities be determined by the
individual module handlers. If a file doesn't exist, it's likely in
the default configuration that the core handler will get it, and it
returnes 405 for all non-GET requests. As it should. By way of
example, 404 very definitely is not the correct response for a PUT to
a non-existent URL, since PUT generally is construed to mean that the
URL should be created if it doesn't exist. I see no reason why POST
can't (in abstract theory) do the same thing.

And very definitely any HTTP client should be able to handle a 405
response to a POST as an error, just like any other 4xx
response. Apache would cerainly be within its rights to return 403
instead, so I'm quite sure 404 is not the only "correct" response.

> ---------- Forwarded message ----------
> Date: Thu Mar 13  8:29:38 1997
> From:
> To:
> Subject: [BUG]: "Status: 405 instead of 404 when POSTing to bad URL" on HPUX
> Submitter:
> Operating system: HPUX, version: 10.20
> Version of Apache Used: 1.2b7
> Extra Modules used: none
> URL exhibiting problem: 
> Symptoms:
> --
> Apache returns error 405 (method not supported)
> when client tries to execute POST with bad URL
> (non-existing path or script name) instead of
> error 404 (not found).%
> --
> Backtrace:
> --
> --

Alexei Kosut <>      The Apache HTTP Server

View raw message