Skip to content

[BrowserKit][HttpClient] Update the value of some user agents to comply with the RFC 9110 specification #50053

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

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

javiereguiluz
Copy link
Member

@javiereguiluz javiereguiluz commented Apr 18, 2023

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets fixes #50052
License MIT
Doc PR -

@javiereguiluz javiereguiluz added this to the 6.3 milestone Apr 18, 2023
@javiereguiluz javiereguiluz changed the title Update the value of some user agents to comply with the RFC 9110 spec… Update the value of some user agents to comply with the RFC 9110 specification Apr 18, 2023
@carsonbot carsonbot changed the title Update the value of some user agents to comply with the RFC 9110 specification [BrowserKit][HttpClient] Update the value of some user agents to comply with the RFC 9110 specification Apr 18, 2023
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, here are some minor comments

@nicolas-grekas
Copy link
Member

Thank you @javiereguiluz.

@nicolas-grekas nicolas-grekas merged commit 03ca033 into symfony:6.3 Apr 18, 2023
@javiereguiluz javiereguiluz deleted the fix_50052 branch April 18, 2023 18:21
nicolas-grekas added a commit that referenced this pull request Apr 21, 2023
…updates in the default user agents (javiereguiluz)

This PR was merged into the 6.3 branch.

Discussion
----------

[BrowserKit][HttpClient] [BrowserKit, HttpClient] Minor updates in the default user agents

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

After merging #50053 I realized that some of my changes were not really needed.

According to the spec, the user agent _"consists of one or more product identifiers, each followed by zero or more comments"_

For example this user agent:

```
Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405
```

`Mozilla/5.0` is the product and version
`AppleWebKit/531.21.10` is a subproduct and its own version
In both cases the version is optional.

So, our user agent `Symfony BrowserKit` is correct:

* `Symfony` is the product, without version (completely legal)
* `BrowserKit` is the subproduct, and omits its version (legal too)

The real issue was with user agents like `Symfony HttpClient/Amp`, because `/Amp` would be interpreted as the version of the `HttpClient`, which is wrong (the version is `6.2`, `6.3`, etc.). The `Amp` text is a detail about a product, so it's common to wrap it in parenthesis.

So, sorry for the noise and I think this time this is fully correct. Thanks.

Commits
-------

e4d3203 [BrowserKit, HttpClient] Minor updates in the default user agents
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the value of Symfony user agent identifiers
3 participants