mirror of
https://github.com/immich-app/immich.git
synced 2024-12-30 11:28:22 +02:00
43e9529ce4
* feat(.well-known): add .well-known/immich to reference API endpoint
* feat(.well-known): make schema optional (defaults to https)
* adjust method comment to be a little less confusing
* fix casting issue with resovled url
* include when checking Well-known, update server hint
* add validation for login form's server url
* consolidate common process into resolveAndSetEndpoint
* fix missed prettier formatting
* revert translation changes
* update environment variable description, hopefully a bit clearer
* rename environment variable to IMMICH_API_URL_EXTERNAL
* comment out optional env variables
* fix(web): browser-side api client to include authorization token
* Revert "fix(web): browser-side api client to include authorization token"
This reverts commit 60e338938f
.
* remove multi-domain related changes
9 lines
246 B
Dart
9 lines
246 B
Dart
String sanitizeUrl(String url) {
|
|
// Add schema if none is set
|
|
final urlWithSchema =
|
|
url.startsWith(RegExp(r"https?://")) ? url : "https://$url";
|
|
|
|
// Remove trailing slash(es)
|
|
return urlWithSchema.replaceFirst(RegExp(r"/+$"), "");
|
|
}
|