Jump to content

[SOLVED] PUT DELETE enabled by default?


frist44

Recommended Posts

in my apache config, i have the following, which i copied from somewhere and should work :)

 

        #   Deny PUT/DELETE Requests
        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(PUT|DELETE)
        RewriteRule .* - [F]

Link to comment
Share on other sites

If I remember correctly, PUT as defined by the HTTP protocol works like this:

 

 

PUT /path/to/somewhere HTTP/1.1

 

 

And then /path/to/somewhere would be the CGI script that handles the PUTting.

 

 

 

And, Apache does not handle the DELETE header in its core.  As far as I know, mod_dav must be in use for DELETE to be used for anything.

 

 

 

More info:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

 

 

 

Hrmm, actually, after looking through the Apache source just now (because I'm curious), it would seem that mod_dav handles PUT as well.

 

/* handle the PUT method */

static int dav_method_put(request_rec *r)

 

But now I'm going to find where that's called from and so on.  (Also, it looks like Script PUT /path/to/a/script can be used to tell Apache what to do with all PUT requests.)

 

 

 

 

 

Hehe this post was over kill, but been curious about this subconsciously for a while now I guess (although I knew that Apache by default does nothing with PUT/DELETE [well not nothing, but essentially nothing]).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.