This is a discussion on 405 (Method not Allowed) when Apache Module DECLINED within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi!, I have a custom module that gets called via handlers for every request that hits the server. I am ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi!, I have a custom module that gets called via handlers for every
request that hits the server. I am using the location tag with a "/" to do this. I don't do any processing in the custom moudle...I just return DECLINED. The original URL I am pointing to is a .pl script. Without my custom module, this script is able to accept POST requests. But the moment I change the httpd.conf to include my handler, I get a 405(Method Post not allowed) Error. It seems to be working okay if I hit the server with a GET from the browser. Does anyone know why this is happening? Any help or direction in this matter will be greatly appreciated. Thanks in advance. Rahul |
|
|||
|
* "kalinga" <rahul_41@yahoo.com> wrote:
> Hi!, I have a custom module that gets called via handlers for every > request that hits the server. I am using the location tag with a "/" to > do this. > > I don't do any processing in the custom moudle...I just return > DECLINED. The original URL I am pointing to is a .pl script. Without my > custom module, this script is able to accept POST requests. But the > moment I change the httpd.conf to include my handler, I get a > 405(Method Post not allowed) Error. > > It seems to be working okay if I hit the server with a GET from the > browser. > > Does anyone know why this is happening? Because your handler declined to handle the request. It ends up in the default core handler, which doesn't handle POST requests. nd |
|
|||
|
Thanks André!,
Is there any way I can get over the problem so that the request hits the URL and can post data to it? Please advice. Could you point me to some place where such stuff is documented. I have been searching all over the place but I can't find anything. Thanks again for the response. Regards, rahul André Malo wrote: > * "kalinga" <rahul_41@yahoo.com> wrote: > > > Hi!, I have a custom module that gets called via handlers for every > > request that hits the server. I am using the location tag with a "/" to > > do this. > > > > I don't do any processing in the custom moudle...I just return > > DECLINED. The original URL I am pointing to is a .pl script. Without my > > custom module, this script is able to accept POST requests. But the > > moment I change the httpd.conf to include my handler, I get a > > 405(Method Post not allowed) Error. > > > > It seems to be working okay if I hit the server with a GET from the > > browser. > > > > Does anyone know why this is happening? > > Because your handler declined to handle the request. It ends up in the > default core handler, which doesn't handle POST requests. > > nd |
|
|||
|
* "kalinga" <rahul_41@yahoo.com> wrote:
> Is there any way I can get over the problem so that the request hits > the URL and can post data to it? Please advice. I'd suggest to use the fixup hook (which is invoked right before the handler is run) to look if you still want to run your handler or something else. If the latter happens, you just change r->handler to the desired value (e.g. "cgi-script") then. > Could you point me to > some place where such stuff is documented. I have been searching all > over the place but I can't find anything. I've got most of my knowledge from the source ;) But there are good books out there, e.g. "Writing Apache Modules with Perl and C". nd |
|
|||
|
Thanks a tonne André for pointing me in the right direction. I will
work on your suggestions after the weekend ;-) Regards, Rahul André Malo wrote: > * "kalinga" <rahul_41@yahoo.com> wrote: > > > Is there any way I can get over the problem so that the request hits > > the URL and can post data to it? Please advice. > > I'd suggest to use the fixup hook (which is invoked right before the > handler is run) to look if you still want to run your handler or something > else. If the latter happens, you just change r->handler to the desired value > (e.g. "cgi-script") then. > > > Could you point me to > > some place where such stuff is documented. I have been searching all > > over the place but I can't find anything. > > I've got most of my knowledge from the source ;) But there are good books > out there, e.g. "Writing Apache Modules with Perl and C". > > nd |
|
|||
|
André, I finally solved the problem copying my code to the post
read-request phase instead of using handlers. This was I do not get a 405. Thanks for your help. I checked out the online copy of the book "Writing Apache Modules with Perl and C" (http://162.105.203.19/apache-doc/1.htm). It is pretty cool :o) André Malo wrote: > * "kalinga" <rahul_41@yahoo.com> wrote: > > > Is there any way I can get over the problem so that the request hits > > the URL and can post data to it? Please advice. > > I'd suggest to use the fixup hook (which is invoked right before the > handler is run) to look if you still want to run your handler or something > else. If the latter happens, you just change r->handler to the desired value > (e.g. "cgi-script") then. > > > Could you point me to > > some place where such stuff is documented. I have been searching all > > over the place but I can't find anything. > > I've got most of my knowledge from the source ;) But there are good books > out there, e.g. "Writing Apache Modules with Perl and C". > > nd |
|
|||
|
* kalinga wrote:
> André, I finally solved the problem copying my code to the post > read-request phase instead of using handlers. This was I do not get a > 405. Thanks for your help. I checked out the online copy of the book > "Writing Apache Modules with Perl and C" > (http://162.105.203.19/apache-doc/1.htm). It is pretty cool :o) Fine :) nd -- Already I've seen people (really!) write web URLs in the form: http:\\some.site.somewhere [...] How soon until greengrocers start writing "apples $1\pound" or something? -- Joona I Palaste in clc |