simulating put and delete in aw

8 views
Skip to first unread message

Watt

unread,
Dec 12, 2008, 12:50:05 PM12/12/08
to antiweb
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 ? it is just a thought exercise that i
would like to be able to answer when i went thru the code. thanks for
your help.



watt p.

do...@hcsw.org

unread,
Dec 14, 2008, 7:58:38 PM12/14/08
to ant...@googlegroups.com
Hi Watt,

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

Watt

unread,
Dec 15, 2008, 9:07:44 PM12/15/08
to antiweb
Hi Doug,

Thanks for your reply. This really helps make it easier to understand
what is going on when I read your code. But your answer leads me to
have another question. I hope you don't mind I ask about your thought
process in the design. Is there any particular advantage in build
your abstraction after the point that you get the request type coming
and not before, hence capturing the request type itself in your
abstractions? Any implementation or efficiency advantage, etc?
Thanks.



Watt P.
>  application_pgp-signature_part
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages