gabrielfalcao / HTTPretty

Intercept HTTP requests at the Python socket level. Fakes the whole socket module
https://httpretty.readthedocs.org
MIT License
2.11k stars 276 forks source link

Request body isn't decoded when client specifies its charset #462

Open sergey-salnikov opened 1 year ago

sergey-salnikov commented 1 year ago

While writing integration tests for an application that uses google-auth-oauthlib, I noticed that it sends requests to Google API with 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'. HTTPrettyRequest.parse_request_body isn't ready for the charset part (relevant source) and doesn't decode such a body.