gotosocial/internal/transport
Daenney a41e8a95bf
[chore] Simplify the User-Agent string (#2645)
* [chore] Simplify the User-Agent string

RFC 9110[1] includes a definition for the format of a user-agent header:

User-Agent = product *( RWS ( product / comment ) )
             product         = token ["/" product-version]
             product-version = token
	     comment        = "(" *( ctext / quoted-pair / comment ) ")"
             ctext          = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text

An example given in the RFC: User-Agent: CERN-LineMode/2.15 libwww/2.17b3

The idea is typically start with the most important product/version, add
a (comment) if necessary and then include any auxilliary products.
However, the RFC warns against including too many auxiliary products as
those can be unnecessarily revealing.

For automated systems (i.e not a browser), the common and recommended
format is <product></version> (+uri-for-contact), followed with any
additional <product>/<version> pairs that are relevant.

This changes our UA to match that convention more closely. This makes it
easier for administrators who do user-agent parsing for statistics or
other purposes to correctly identify the version of GoToSocial.
Currently tools tend to get confused by the lack of a /<version> on the
start of our string.

[1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agents

* [chore] Don't use app name in UA

From all the GtS UAs I've collected, nobody seems to set/change this,
so we might as well use the static string.

The main usefulness for this is when you have multilpe GtS instances
connecting to the same DB, so they can identify as different instances
by changing the application name (though it should already be obvious
from having different usernames).
2024-02-17 09:54:10 +01:00
..
controller.go [chore] Simplify the User-Agent string (#2645) 2024-02-17 09:54:10 +01:00
deliver.go [performance] overhaul struct (+ result) caching library for simplicity, performance and multiple-result lookups (#2535) 2024-01-19 12:57:29 +00:00
dereference.go [bugfix] add stricter checks during all stages of dereferencing remote AS objects (#2639) 2024-02-14 12:13:38 +01:00
derefinstance.go [bugfix] add stricter checks during all stages of dereferencing remote AS objects (#2639) 2024-02-14 12:13:38 +01:00
derefmedia.go [chore] tidy up media manager, add calling func to errors, build-script improvements (#1835) 2023-05-28 14:08:35 +02:00
finger.go [bugfix] add stricter checks during all stages of dereferencing remote AS objects (#2639) 2024-02-14 12:13:38 +01:00
finger_test.go [performance] overhaul struct (+ result) caching library for simplicity, performance and multiple-result lookups (#2535) 2024-01-19 12:57:29 +00:00
signing.go [feature] Try HTTP signature validation with and without query params for incoming requests (#2591) 2024-01-31 14:15:28 +00:00
transport.go [feature] Try HTTP signature validation with and without query params for incoming requests (#2591) 2024-01-31 14:15:28 +00:00
transport_test.go [bugfix] process account delete side effects in serial, not in parallel (#2360) 2023-11-14 15:57:25 +01:00