Hello, Im using utf-u as the default external format in my web application (yet another social news site). Some sites have started to add links to our site, passing the title of their news as a GET parameter in the link. The problem is that one of those sites is encoding the title string using iso-8859 encoding, which causes hunchentoot to return a "Your browser sent a request that this server could not understand." and a log error that looks like "Error when creating REQUEST object: Unexpected value #x20 in UTF-8 sequence.".
Is there a way I can catch the error so that I can either to ignore the parameters or try to recompute the REQUEST object using iso-8859 encoding?
Thanks Sergio
On Thu, 8 May 2008 16:37:50 +0200, "Sergio Garcia" sergio.garcia@gmail.com wrote:
Is there a way I can catch the error so that I can either to ignore the parameters or try to recompute the REQUEST object using iso-8859 encoding?
With the current design this is a bit tricky, but you're lucky: Hans is currently re-working Hunchentoot's internal and in the next release the request parameters will be computed later when you can actually handle the error (I think).
Edi.
On Thu, May 8, 2008 at 4:57 PM, Edi Weitz edi@agharta.de wrote:
With the current design this is a bit tricky, but you're lucky: Hans is currently re-working Hunchentoot's internal and in the next release the request parameters will be computed later when you can actually handle the error (I think).
Edi.
Thanks for the info, Edi (in the meantime I just brutally patched my hunchentoot to catch errors on the computation of get parameters and re-try it with an iso-8859 encoding :/ )
off-topic: I think it would be handy to have a add-get-param-to-url in hunchentoot. Like url-rewrite's one, but using hunchentoot-default-external-format for the encoding.
On Fri, 9 May 2008 20:25:00 +0200, "Sergio Garcia" sergio.garcia@gmail.com wrote:
off-topic: I think it would be handy to have a add-get-param-to-url in hunchentoot. Like url-rewrite's one, but using hunchentoot-default-external-format for the encoding.
I agree. URL-REWRITE was written before the glory days of FLEXI-STREAMS, but it should simply use them now and there shouldn't be any code duplication between Hunchentoot and URL-REWRITE.
Actually, as Hunchentoot seems to be the only consumer of URL-REWRITE, it's probably the cleanest solution to integrate URL-REWRITE into Hunchentoot. As part of The Big Cleanup. RSN!