On Tue, 24 Dec 2002 [EMAIL PROTECTED] wrote: > Hi all > > Apologise if I have posted to the wrong list. I am quite new to the > Perl*Handlers. I am wondering if it is possible to write a handler > which parses the very first header line, say.. > > > telnet localhost http > Trying 127.0.0.1 > Connected to localhost. > Escape character is '^]' > > [C] THIS_IS_NOT_A_USUAL_HTTP_HEADER\r\n > [S] YOUR_REQUEST_IS_UNDERSTOOD,_SEND_MORE_DETAIL\r\n > [C] Other: non-usual-http-headers-here\r\n > [S] balbalbal..closing connection\r\n > Connection closed by remote host. > > where the line followed by [C] stands for the line sent by the client, > and the line followed by [S] is the line sent by some perl module. > > I would like to have the other GET/POST requests being processed like > any other server does (i.e. if the request line is a usual GET/POST > line, the handler bypasses it, otherwise the handler will make apache > 'sends' the request to another perl module that knows how to handle > this request).
If all you want to do is handle certain requests in a special manner, and you are able to have control over the requests, why do you not use a simpler scheme, such as directing them to a different port, or, better yet, a different URI? If you are getting the requests from a browser it will be difficult anyway to add custom headers, I think. But if you can control the request you can easily have http://your.server.com/path/to/resource/special http://your.server.com/path/to/resource or something similar, and have a handler that handles everything in that path, returning DECLINED if it doesn't match the URI you are looking for (you don't need two handlers for this). Hope this helps, - nick