>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: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.2b10
>Environment:
Linux 2.0.18
gcc 2.7.2.1
>Description:
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.
>How-To-Repeat:
>Fix:
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
>Audit-Trail:
>Unformatted: