Skip to content

Update the value of Symfony user agent identifiers #50052

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

Closed
javiereguiluz opened this issue Apr 18, 2023 · 1 comment · Fixed by #50053
Closed

Update the value of Symfony user agent identifiers #50052

javiereguiluz opened this issue Apr 18, 2023 · 1 comment · Fixed by #50053

Comments

@javiereguiluz
Copy link
Member

Description

I was checking this PHP PR: php/php-src#11093 and I realized that in Symfony we have the opposite problem. Instead of "server software", we define the "client software" via the User Agent in several components.

The User Agent format is defined in RFC 9110: https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agent

User-Agent = product *( RWS ( product / comment ) )

And:

product         = token ["/" product-version]
product-version = token

And a token in this context is:

Tokens are short textual identifiers that do not include whitespace or delimiters.

  token          = 1*tchar

  tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
                 / DIGIT / ALPHA
                 ; any VCHAR, except delimiters

So, user agents can omit the version if they want, but the identifier can't contain spaces.


That's why I think we should update these user agents:

(1) Rename this one as SymfonyBrowserKit ?

'HTTP_USER_AGENT' => 'Symfony BrowserKit',

(2) Rename this one as SymfonyHttpClient (Amp) ?

$options['headers'][] = 'User-Agent: Symfony HttpClient/Amp';

(3) Rename this one as SymfonyHttpClient (Curl) ?

$options['headers'][] = 'User-Agent: Symfony HttpClient/Curl';

(4) Rename this one as SymfonyHttpClient (Native) ?

$options['headers'][] = 'User-Agent: Symfony HttpClient/Native';

Thanks

Example

No response

@nicolas-grekas
Copy link
Member

Yes, let's do these changes. Can you please send a PR?

nicolas-grekas added a commit that referenced this issue Apr 18, 2023
… agents to comply with the RFC 9110 specification (javiereguiluz)

This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

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

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

Commits
-------

722bd99 [BrowserKit][HttpClient] Update the value of some user agents to comply with the RFC 9110 specification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants