matthiask/towel — pull request #8 by guetux (2012-08-27 18:03:45+00:00)
Title: Remain compatible with apache http client

The introduced parser handling for different request bodies generates some problems with certain http libraries as the apache http client (http://hc.apache.org/httpcomponents-client-ga/). For no obvois reasons the library also sends a charset and i get an error like:

'application/x-www-form-urlencoded; charset=UTF-8' is not supported

This patch solves the problem by only matching the first part of content type to find a corresponding parser. str.startswith would be faster, but regex is more extendable. What do you think?