hunchentoot icon indicating copy to clipboard operation
hunchentoot copied to clipboard

Encoding errors while parsing www-form-urlencoded post requests are fatal

Open rongarret opened this issue 8 years ago • 0 comments

The HTTP standard has no way for a client to specify a character encoding for www-form-urlencoded POST data. So you have to guess. And if you guess utf-8 and you end up being wrong and generating a UTF-8 parse error, then there is no way to recover because maybe-read-post-parameters is hard-coded to call abort-request-handler if the parse fails.

There's a hacky workaround for this by always parsing first to latin-1 (which can't fail) and then converting to UTF-8 afterwards, but it seems like there really ought to be a better way to handle this.

rongarret avatar Jul 11 '16 20:07 rongarret