www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Lister <p.lis...@cranfield.ac.uk>
Subject mod_dir/655: mod_dir should DECLINE PUT method rather than NOT_IMPLEMENTED
Date Mon, 02 Jun 1997 15:00:02 GMT

>Number:         655
>Category:       mod_dir
>Synopsis:       mod_dir should DECLINE PUT method rather than NOT_IMPLEMENTED
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Mon Jun  2 08:00:01 1997
>Originator:     p.lister@cranfield.ac.uk
>Release:        1.2b10
Linux 2.0.18
I'm trying to implement handlers to permit uploading to the server (initially
using CGIs, now mod_perl). handle_dir rejects all PUTs to directories with

    if (r->method_number != M_GET) return NOT_IMPLEMENTED;

While I appreciate that, PUTs should not be enabled, mod_dir should not state
that PUTs are impossible, only that it can't do them by returning DECLINED.
I reckon that only http_core and http_config have the right to state that PUTs
to directories are not implemented, since (as I understand it) only they can
state with certainty that either no handler was configured or that all the
handlers DECLINED.

I consider this a bug. Note that since the request CAN be intercepted if the
URL is non-existant; I can therefore treat any non-existant URL as a
directory yet to be created and call mkdir - but I can't modify that directory
once created! mod_status also feels it has the right to say NOT_IMPLEMENTED.
This is also arguably wrong, and I feel it should DECLINE.

handle_dir should return DECLINED rather than NOT_IMPLEMENTED so that other
handlers (e.g. mod_perl) can get a look in.

I have made this change in my local mod_dir.c and it has the desired effect.

However, there appear to be knock-on effects in doing this, so this fix is
presumably showing up other invalid assumptions elsewhere in Apache.
Specifically, when a PUT handler for a directory has NOT been specified, the
code which returns a relocation to the directory name with "/" appended runs
unecessarily, and the URL ends up with 2 trailing "/". If I find out where, I'll
let you know

View raw message