On Fri, Dec 12, 2008 at 09:50:05AM -0800 or thereabouts, Watt wrote:
> another question i have after reading your antiweb code is - since
> post and get are hard coded, would it be possible to simulate put and
> delete thru rewrite module ?
Thanks for your question. No, you can't simulate new HTTP methods
through the rewrite module. They will need to be accomodated in
several places in the code. Here are the places I can think of:
hub-accept-http-connection
- Needs regexp changed (easy difficulty)
http-user-dispatch-macro
- Needs regexp changed (easy difficulty)
http-user-dispatch-macro-request-handler
- The semantics of the request need to be thought out. For instance,
PUT will send a content body (like POST) while DELETE will not
(like GET). (medium difficulty)
modules.lisp
- How will your new method interact with modules? What happens
if somebody sends a DELETE method to a CGI script say?
You will either need to update all modules that can handle
your method or ensure that such methods never reach modules
that don't know what to do with your method (hard).
Honestly, I don't really want to support methods other than
GET and POST. I only have HEAD in there because the iPhone cydia
client sends a HEAD request and I was hosting a cydia repo for
a few weeks until my client moved it to their site. The HEAD
support is just turned into a GET request so it's not really
correct but it saved me from having to rethink all the modules.
(What should happen when you send a HEAD to a CGI script?)
I may remove HEAD support in the future.
Hope this helps,
Doug