[Bese-devel] ucw_ajax and Accept-Language header

Sasha Kovar sasha-lisp at arcocene.org
Wed May 7 22:55:02 UTC 2008


I'm seeing a badly formatted Accept-Language header in some browser out in
the wilds of the internet.  Contrary to the HTTP spec, it wraps the value in
square brackets, e.g. "[en-us, en, ko-kr, kr, ko, ja, jp, cn]".  

This is triggering a parse error when "[en-us" is passed to cl-l10n, as it
tries to use the passed value as part of a namestring.  Rather than debate
the wisdom of that, it seemed more correct to clean up what UCW is
handing to cl-l10n.  Brackets aren't allowed in the language range, so there
should be no danger in removing them.

The attached patch just strips any '[' or ']' characters from the header
when parsing.  Test with:  
  (parse-accept-language-header "[en-us, en, ko-kr, kr, ko, ja, jp, cn]")

If that looks reasonable, could someone please apply the patch?

Thanks much,
Sasha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: accept-lang.patch
Type: text/x-diff
Size: 33901 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20080507/77d942ff/attachment.patch>


More information about the bese-devel mailing list