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

User-Agent string violates RFC9113 #12921

Closed
rbrand3479 opened this issue Sep 27, 2022 · 0 comments · Fixed by #12925
Closed

User-Agent string violates RFC9113 #12921

rbrand3479 opened this issue Sep 27, 2022 · 0 comments · Fixed by #12925
Labels

Comments

@rbrand3479
Copy link

Downloading an image with HTTP/2 results in a message:

HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

I tracked down the issue to the user-agent string that ends with a whitespace character. It is defined in downloader.rb, line 24 as

USER_AGENT = "Vagrant/#{VERSION} (+https://www.vagrantup.com; #{RUBY_ENGINE}#{RUBY_VERSION}) #{ENV['VAGRANT_USER_AGENT_PROVISIONAL_STRING']}".freeze

If no VAGRANT_USER_AGENT_PROVISIONAL_STRING is set, a whitespace is the last character. This violates RFC 9113, Section 8.2.1:

  • A field value MUST NOT start or end with an ASCII whitespace
    character (ASCII SP or HTAB, 0x20 or 0x09).

    | Note: An implementation that validates fields according to the
    | definitions in Sections 5.1 and 5.5 of [HTTP] only needs an
    | additional check that field names do not include uppercase
    | characters.

    A request or response that contains a field that violates any of
    these conditions MUST be treated as malformed (Section 8.1.1). In
    particular, an intermediary that does not process fields when
    forwarding messages MUST NOT forward fields that contain any of the
    values that are listed as prohibited above.

@rbrand3479 rbrand3479 added the bug label Sep 27, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant