Files
Nim/lib/pure
Yardanico 94ffc18332 Fix #22862 - change the httpclient user-agent to be valid spec-wise (#22882)
Per https://datatracker.ietf.org/doc/html/rfc9110#name-user-agent a
User-Agent is defined as follows:
```
  User-Agent = product *( RWS ( product / comment ) )
```
Where
```
  product         = token ["/" product-version]
  product-version = token
```
In this case, `token` is defined in RFC 7230 -
https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6:
```
     token          = 1*tchar

     tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
                    / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
                    / DIGIT / ALPHA
                    ; any VCHAR, except delimiters
```
or, in the original RFC 2616 -
https://datatracker.ietf.org/doc/html/rfc2616#section-2.2 (next page):
```
       token          = 1*<any CHAR except CTLs or separators>
       separators     = "(" | ")" | "<" | ">" | "@"
                      | "," | ";" | ":" | "\" | <">
                      | "/" | "[" | "]" | "?" | "="
                      | "{" | "}" | SP | HT
```
which means that a `token` cannot have whitespace. Not sure if this
should be in the breaking changelog section - theoretically, some
clients might've relied on the old Nim user-agent?

For some extra info, some other languages seem to have adopted the same
hyphen user agent to specify the language + module, e.g.:
-
https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L1679
(`Python-urllib/<version>`)

Fixes #22862.
2023-10-29 06:21:32 +01:00
..
2023-05-29 21:31:53 +02:00
2023-04-29 09:50:46 +02:00
2015-10-01 12:05:45 -07:00
2023-10-26 13:07:50 +02:00
2021-01-09 00:24:41 +01:00
2023-06-06 21:22:07 +02:00
2023-06-20 13:04:34 +02:00
2023-10-23 09:11:13 +02:00
2023-06-08 08:02:11 +02:00
2022-12-26 13:20:05 +01:00
2022-12-16 08:01:15 +01:00
2022-12-03 21:25:49 +08:00
2023-03-20 18:51:58 +01:00
2021-02-08 09:46:07 +01:00
2022-02-02 17:10:11 +01:00