-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
default user-agent header is malformed #286
Comments
Thanks for reporting this; sorry this caused so much trouble for you! This looks to be how Isahc sends all custom header fields with HTTP/1.x (without whitespace), not just the user agent. This is compliant with RFC 7230, section 3.2. However, this is a bit unusual and it would probably be better for us to include a single space after the |
Previously headers were sent with no whitespace before or after the colon (`:`). This is legal according to RFC 7230, section 3.2, but is somewhat unusual and can cause poorly-written servers to choke on parsing the request. Update the encoder to always add a single space after the colon to be in line with what most parsers should expect. This has no effect on HTTP/2 or newer, since they use a binary format for headers. Fixes #286.
Previously headers were sent with no whitespace before or after the colon (`:`). This is legal according to RFC 7230, section 3.2, but is somewhat unusual and can cause poorly-written servers to choke on parsing the request. Update the encoder to always add a single space after the colon to be in line with what most parsers should expect. This has no effect on HTTP/2 or newer, since they use a binary format for headers. Fixes #286.
This is now fixed in the 1.0.2 release! |
Thanks for the quick fix! Awesome work here |
I just hit this problem today - 18 months later - when using surf Glad to see my bug report isn't needed. 😄 |
Unfortunately Surf uses a very old version of Isahc, so there's not much I can do about that other than advocating that they upgrade to a newer version, which included this, and many other fixes. |
This drove me insane to figure out. This library is sending out a malformed
user-agent
header.This library sends
user-agent:curl/7.74.0 isahc/1.0.1
compared to stock cURL:User-Agent: curl/7.74.0
.There is a space omitted after the colon. While this doesn't seem to be invalid HTTP 1/1, It will trip up crappy http parsers who assume
:
for header fields.Thanks for building one of the only Rust HTTP libraries that supports Unix sockets!
The text was updated successfully, but these errors were encountered: