mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-13 19:21:12 +02:00
Add consistent User-Agent header to all HTTP clients
Create UserAgentClient (http.BaseClient wrapper) that injects a User-Agent header into every request, reading app name and version from VersionService and contact/homepage from dev_config.dart. Format follows OSM tile usage policy: DeFlock/<version> (+https://deflock.org; contact: admin@stopflock.com) Replaces 4 inconsistent hardcoded UA strings and adds UA to the 9 call sites that previously sent none. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
fe20356734
commit
0137fd66aa
16 files changed
+177
-43
No files matched your search
@@ -5,6 +5,7 @@ import 'package:http/http.dart' as http;
|
||||
import '../models/pending_upload.dart';
|
||||
import '../dev_config.dart';
|
||||
import '../state/settings_state.dart';
|
||||
import 'http_client.dart';
|
||||
import 'version_service.dart';
|
||||
|
||||
class UploadResult {
|
||||
@@ -348,6 +349,7 @@ class Uploader {
|
||||
Map<String, String> get _headers => {
|
||||
'Authorization': 'Bearer $accessToken',
|
||||
'Content-Type': 'text/xml',
|
||||
'User-Agent': UserAgentClient.userAgent,
|
||||
};
|
||||
|
||||
/// Sanitize text for safe inclusion in XML attributes and content
|
||||
|
||||
Reference in new issue
Block a user