mirror of
https://github.com/immich-app/immich.git
synced 2025-12-24 01:11:32 +03:00
fix(mobile): server endpoint input auto parse https when not specified (#5326)
This fixes issue #4397 and automatically adds the https protocol to the server endpoint url if it is missing Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -3,10 +3,10 @@ import 'package:immich_mobile/shared/models/store.dart';
|
||||
String sanitizeUrl(String url) {
|
||||
// Add schema if none is set
|
||||
final urlWithSchema =
|
||||
url.startsWith(RegExp(r"https?://")) ? url : "https://$url";
|
||||
url.trimLeft().startsWith(RegExp(r"https?://")) ? url : "https://$url";
|
||||
|
||||
// Remove trailing slash(es)
|
||||
return urlWithSchema.replaceFirst(RegExp(r"/+$"), "");
|
||||
return urlWithSchema.trimRight().replaceFirst(RegExp(r"/+$"), "");
|
||||
}
|
||||
|
||||
String? getServerUrl() {
|
||||
|
||||
Reference in New Issue
Block a user