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

[8.x] HTTP client: only allow a single User-Agent header #39085

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

julesjanssen
Copy link
Contributor

Currently, using this method appends the specified UserAgent string to the headers list. Calling this method twice will send a request with two User-Agent header lines. This is not accepted as valid by a lot of services.

See also.

This PR overrides the User-Agent header instead of appending it.

@driesvints
Copy link
Member

Heya, as discussed in the other PR, we're wondering if it even makes sense to append any header like that. Maybe we should patch the withHeaders itself? In any case, wait a bit until @taylorotwell has replied to this.

@julesjanssen
Copy link
Contributor Author

According to this SO answer it should technically be possible.
But I think it only makes sense for a limited set of headers (like Cache-Control).

@taylorotwell taylorotwell merged commit 060960a into laravel:8.x Oct 5, 2021
victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants