Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation and implementation do not align on default protocols used #300

Closed
LostKobrakai opened this issue Feb 16, 2024 · 2 comments
Closed

Comments

@LostKobrakai
Copy link

req/lib/req.ex

Lines 297 to 298 in bfabe15

* `:protocols` - the HTTP protocols to use, defaults to `[:http1, :http2]`, that is default to HTTP/1 but if negotiated, allow HTTP/2
over HTTP/1 connection. To force HTTP/2, set `protocols: [:http2]`.

Documented to use both http1 and http2

req/lib/req/steps.ex

Lines 983 to 984 in bfabe15

protocols:
connect_options[:protocols] || List.wrap(connect_options[:protocol] || :http1)

Implementation default is just http1

@wojtekmach
Copy link
Owner

Good catch, implementation is wrong and we should be sending to Finch protocols: [:http1, :http2] by default.

@wojtekmach
Copy link
Owner

FYI I've temporarily switched back to protocols: [:http1] due to sneako/finch#265. The plan is to go back to http1+http2 once that's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants