[hunchentoot-devel] Re: Hunchentoot's query parameter seperator
Edi Weitz
edi at agharta.de
Thu Nov 22 09:30:38 UTC 2007
Hi,
On Tue, 20 Nov 2007 09:31:01 -0500, "Kyle R. Burton" <kyle.burton at gmail.com> wrote:
> I'm not sure if there is a mailing list that would be more
> appropriate.
Really?
http://weitz.de/hunchentoot/#mail
I'd appreciate if we could continue this discussion on the list, see
Cc. (You have to subscribe first, of course.)
> I'd like to start by saying thanks for Hunchentoot! (and all the
> other CL libraries you've developed).
You're welcome... :)
> I am just starting with Hunchentoot, but I noticed that the query
> string parser supports ampersand (&) as a pair separator and I
> rememberd semi-colon (;) also being a valid separator for query
> strings. I only remember this from having worked with Perl's CGI.
> A bit of quick searching on the net lead me to:
>
> http://en.wikipedia.org/wiki/Query_string
> http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2
>
> to confirm that the semi-colon is mentioned as a separator.
I have to admit that this is the first time I've heard of this
recommendation. A quick test with the vastly popular PHP shows that
they don't implement it either:
<? print_r($_GET); ?>
Try these:
http://zappa.agharta.de/test.html?foo=bar&baz=quux
http://zappa.agharta.de/test.html?foo=bar;baz=quux
So, to everyone on the list - what's your experience with semicolons
as query string separators? Is this normal or esoteric? And, even
more interesting, does any client out there actually use this
convention?
> I looked into the sources and I think the minor change is in
> defmethod initialize-instance :after, to just update the split from:
>
> (form-url-encoded-list-to-alist (split "&" query-string))
>
> to
>
> (form-url-encoded-list-to-alist (split "[;&]" query-string))
>
> A quick empirical test with a browser shows symptoms of working:
>
> /lisp/test?foo=bar&qux=baz&blarf=qbozzle
> /lisp/test?foo=bar;qux=baz;blarf=qbozzle
>
> I'm new to CL so I'm not entirely confident of my suggestion...
Seems OK, but it might break existing applications.
> Also, is there a place in the source tree for any kind of unit tests
> or assertions? I'd have added one for this test, but I didn't
> recognize where it would have been appropriate to put it.
No, only the demo in the "test/" directory.
> Is this something you'd consider enhancing Hunchentoot with?
Lots of stuff...
Cheers,
Edi.
More information about the Tbnl-devel
mailing list