Skip to content

Update the value of Symfony user agent identifiers #50052

Closed
@javiereguiluz

Description

@javiereguiluz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions