Comments (7)
I agree. Please open a separate issue. I think having a separate library that handles IDNA would be ideal, we would only need some documentation on how to use the the library with Mint.
from mint.
I think this HTTP library should focus on HTTP handling, rather than having all convenient features for HTTP clients.
For "url helper methods", such as validation, auto-fix:
- "modern" browser behavior is not necessarily "standard"
- If bad value is given, then HTTP library should fail, instead of trying to auto-fix it
Those "convenience" features should be built on higher level, not this HTTP library level. For example, I'm using tesla and I can do all with Tesla middleware (e.g. see Tesla.Middleware.BaseUrl) - so that underlying HTTP library (e.g. hackney, httpc..) doesn't need to handle this.
For IDNA:
We may end up with common interface for IDNA (like we do for Json with jason and poison) so that we can evolve/release mint without being coupled with specific idna library.
from mint.
Forgive my ignorance but I am not an expert in this area. What would be missing from the Elixir URI module in the stdlib that we might want to add here?
from mint.
Well, I'm not sure if it's needed in Elixir Core, but for HTTP Client next functionality might be useful:
-
URL normalization:
# all examples are working in modern browsers "https://////www.google.com" -> "https:/www.google.com" "https://你好你好" -> "https://xn--6qqa088eba/" "https://0Xc0.0250.01" -> "https://192.168.0.1/"
-
URL validation:
https://www .google.com -> false
-
Relative URLs:
"../foo?a=bar#bazz" with base "https://www.google.com/maps" -> "https://www.google.com/foo?a=bar#bazz"
from mint.
Thanks for starting this discussion. Since xhttp is still being developed we should do this in steps, preferably small steps.
I think we can start by adding idna. We can use the library hackney uses but in the future I would like to investigate if we can reduce the size of the idna modules by implementing them in elixir and do the same code size optimizations elixir core does for the unicode modules (joining similar clauses and so on).
I would like to wait with the other whatwg normalizations, until we have looked at it more, for two main reasons; the whatwg spec looks very complex and I'm not sure a generic http client should have the same behavior as a browser.
Does this sound good to you?
from mint.
@ericmj This sounds really good. We will pend with investigations until something will become more clear. Hope this thread will help with coordinations upon given topic in the future.
from mint.
I agree with @chulkilee. I think we can close this issue and open one that will remind us to look into a IDNA interface. Wdyt @ericmj?
from mint.
Related Issues (20)
- Getting returned absolutely nothing from a HTTP request HOT 2
- Proper usage of :public_key.cacerts_get/0 HOT 8
- Process receives additional messages when using HTTPS/SSL HOT 3
- HTTP/3 HOT 3
- Dialyzer error when using Mint.HTTP2.get_window_size/2 HOT 11
- Flow Control: How to decide whether to stream the body or not HOT 7
- HTTP/2 server settings are handled as client settings HOT 3
- Basic authorization a la Curl HOT 1
- FunctionClauseError when closing a conn in state :handshaking HOT 2
- Mint.HTTP1.Request private fn validate_header_value throws Erlang error: {:bad_generator, nil} when value is nil HOT 1
- Network errors doesn't surface correctly in IPv6-only network HOT 4
- Passive mode HTTP/2 error in Mint v1.5 HOT 9
- Log of read only connection stream gives connection closed messages HOT 3
- Confusing `Mint.HTTP2.open?/2` HOT 4
- Random timeout errors HOT 2
- Calls to `Mint.HTTP.recv/3` hang and error when more than number of bytes remaining requested HOT 4
- How can refs help in figuring out which response belongs to which request? HOT 14
- `Mint.HTTP1` leaks socket upon receive timeout HOT 3
- Too many `Mint.TransportError socket closed` HOT 2
- `:ssl_closed` unknown messages on `www.apple.com` HOT 7
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 mint.