mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix: user-agent format (#27488)
* fix: user-agent format * ci: fix static analysis --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
Future<String> getUserAgentString() async {
|
||||
final packageInfo = await PackageInfo.fromPlatform();
|
||||
String platform;
|
||||
if (Platform.isAndroid) {
|
||||
platform = 'Android';
|
||||
platform = 'android';
|
||||
} else if (Platform.isIOS) {
|
||||
platform = 'iOS';
|
||||
platform = 'ios';
|
||||
} else {
|
||||
platform = 'Unknown';
|
||||
platform = 'unknown';
|
||||
}
|
||||
return 'Immich_${platform}_${packageInfo.version}';
|
||||
return 'immich-$platform/${packageInfo.version}';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user