Skip to content

Set the HTTP user agent #406

Closed
Closed
@gnprice

Description

@gnprice

Currently when we make an HTTP request, the User-Agent header we send is just whatever the default is that Dart's HTTP implementation gives us. This means e.g. that log lines on the server look like this, saying "via Dart":

2023-11-21 22:32:07.353 INFO [zr] 192.168.0.188   POST    200 113ms (db: 35ms/41q) /api/v1/register (11@zulip via Dart)

Instead we should set a user-agent string that identifies this app. Ideally it should include the app's version number.

There are at least two different kinds of HTTP requests the app makes, both of which should have the user agent set:

  • Zulip API calls, which go through ApiConnection.send;
  • fetching images, including avatars, image emoji, and images included in messages, all of which go through RealmContentNetworkImage.

It's likely those will need to be handled separately.

Metadata

Metadata

Assignees

Labels

a-apiImplementing specific parts of the Zulip server API

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions