fix: preserve subpath for Nextcloud instances hosted on sub-paths

This commit is contained in:
2026-05-12 11:56:47 +03:00
parent 38b5d8b464
commit 0c575eaa26

View File

@@ -34,8 +34,11 @@ class ApiClient {
Uri _uri(String path, [Map<String, String>? queryParameters]) {
final base = Uri.parse(_credentials.serverUrl);
final prefix = base.path.endsWith('/')
? base.path.substring(0, base.path.length - 1)
: base.path;
return base.replace(
path: '$basePath$path',
path: '$prefix$basePath$path',
queryParameters: queryParameters,
);
}