Re: how to send 405

This is a discussion on Re: how to send 405 within the Linux Web Servers forums, part of the Web Server and Related Forums category; Brian wrote: > I have a form mail script (TFmail from NMS) that I'm testing on Apache > 2....


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-08-2004
Joshua Slive
 
Posts: n/a
Default Re: how to send 405

Brian wrote:
> I have a form mail script (TFmail from NMS) that I'm testing on

Apache
> 2.0/WinXP; it will eventually go on an Apache 1.3/Linux server. The
> script works fine when form data is posted to it, but it throws a

script
> error if any other method is used. This is a (minor) problem if

someone
> bookmarks the "message sent" success page generated by the script, so

I
> wanted to prevent GET access to the script. Is there any way to

generate
> a 405 http error via .htaccess?
>
> A Google search of the web and this group showed only hits for trying

to
> avoid 405 errors on POST requests.


<LimitExcept POST>
Order allow,deny
Deny from all
</LimitExcept>

Or just have your cgi script check the REQUEST_METHOD and error-out if
it isn't POST.

Joshua.

  #2 (permalink)  
Old 08-11-2004
Brian
 
Posts: n/a
Default Re: how to send 405

Joshua Slive wrote:

> Brian wrote:
>
>> I have a form mail script (TFmail from NMS)


>> it throws a script error if any other method is used.


>> I wanted to prevent GET access to the script. Is there any way to
>> generate a 405 http error via .htaccess?


> <LimitExcept POST>
> Order allow,deny
> Deny from all
> </LimitExcept>


Thanks for the idea. I tried this, but Apache returns 403, not 405. Not
exactly a mission critical thing, I know. But 403 is returned for other
resources, whereas 405 would be for just this situation, so the error
message could be more specific and more helpful.

> Or just have your cgi script check the REQUEST_METHOD and error-out
> if it isn't POST.


That may be the only way to go. It errors out on !POST, but the script's
error message is not very helpful. I was hoping to do better via Apache,
but there does not appear to be a way to generate 405 and serve up a
document via ErrorMessage.

Thanks for your time.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0