Comments (3)
Patron currently doesn't parse the content for anything and I would like to keep it that way. What I will do is make the charset coercion optional and allow users to specify which Content-Types should be coerced and a fallback type.
from patron.
is it optional now? (Docs?)
edit: My particular issue was solved by setting session.default_response_charset
from patron.
This needs to be tackled a bit more broadly IMO. The problem you saw is not unique, in that for example in Russia there was long a custom of forcing charset headers onto pages that had an entirely different charset specified in the HTML. Parsing HTML is out of scope for Patron (I agree with @toland on this), but I think there might be an extra method on the Response
called something like binary_body
for the cases when the encoding detection failed or didn't work for some reason. Then the user would be able to revert to handling the encoding manually, including all possible scenarios such as a corpus-based charset guesser, or an HTML parser, or whatevs.
from patron.
Related Issues (20)
- Release 0.8 HOT 1
- Automate the Patron release process HOT 5
- Idea: Connection pooling using curl_multi HOT 4
- Add streaming upload/download support HOT 1
- Release new version HOT 2
- The Hive copyright comment HOT 1
- Respond to signals when outside the GIL HOT 3
- Headers aren't parsed correctly for first request when connection is proxied HOT 1
- Redirect handling inconsistency HOT 3
- VCR issues after upgrading patron 0.10.0 -> 0.11.1 HOT 6
- RFC: Streaming response bodies HOT 8
- PATCH method doesn't send body HOT 4
- Gem not installed to ruby 2.1.2 HOT 1
- how to set ssl client_key / client_cert ? HOT 6
- Request: Render full server response as a string HOT 1
- Figure out the actual set of supported HTTP verbs
- --http1.1 option please HOT 1
- "checking for ruby/thread.h... *** extconf.rb failed ***" when installing on google/cloud-sdk:alpine docker image HOT 1
- one rspec test fails on Arch Linux
- Basic Auth HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patron.