Skip to content

Commit 81b1b3b

Browse files
committed
core: Send hardcoded User-Agent header in requests
This is required for the server to automatically mark sent messages as read. See `sent_by_human` in `zulip/zerver/models.py`. Fixes: #440
1 parent 01e4f14 commit 81b1b3b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/api/core.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ class ApiConnection {
6969
}
7070
}
7171

72+
void addUserAgent(http.BaseRequest request) {
73+
request.headers['User-Agent'] = 'ZulipMobile/?.?.? (Android 14)';
74+
}
75+
7276
final http.Client _client;
7377

7478
bool _isOpen = true;
@@ -80,6 +84,7 @@ class ApiConnection {
8084
assert(debugLog("${request.method} ${request.url}"));
8185

8286
addAuth(request);
87+
addUserAgent(request);
8388

8489
final http.StreamedResponse response;
8590
try {

0 commit comments

Comments
 (0)