diff --git a/API/Controllers/AccountController.cs b/API/Controllers/AccountController.cs
index b14bac8c1..0ff5882d5 100644
--- a/API/Controllers/AccountController.cs
+++ b/API/Controllers/AccountController.cs
@@ -1018,7 +1018,20 @@ public class AccountController : BaseApiController
if (!string.IsNullOrEmpty(serverSettings.HostName)) origin = serverSettings.HostName;
var baseUrl = string.Empty;
- if (!string.IsNullOrEmpty(serverSettings.BaseUrl) && !serverSettings.BaseUrl.Equals(Configuration.DefaultBaseUrl)) baseUrl = serverSettings.BaseUrl + "/";
+ if (!string.IsNullOrEmpty(serverSettings.BaseUrl) &&
+ !serverSettings.BaseUrl.Equals(Configuration.DefaultBaseUrl))
+ {
+ baseUrl = serverSettings.BaseUrl + "/";
+ if (baseUrl.EndsWith("//"))
+ {
+ baseUrl = baseUrl.Replace("//", "/");
+ }
+
+ if (baseUrl.StartsWith("/"))
+ {
+ baseUrl = baseUrl.Substring(1, baseUrl.Length - 1);
+ }
+ }
return Ok(origin + "/" + baseUrl + "api/opds/" + user!.ApiKey);
}
diff --git a/API/config/appsettings.Development.json b/API/config/appsettings.Development.json
index 54f42804c..90faa9e5f 100644
--- a/API/config/appsettings.Development.json
+++ b/API/config/appsettings.Development.json
@@ -2,6 +2,7 @@
"TokenKey": "super secret unguessable key that is longer because we require it",
"Port": 5000,
"IpAddresses": "",
- "BaseUrl": "/",
- "Cache": 90
-}
+ "BaseUrl": "/test/",
+ "Cache": 90,
+ "XFrameOrigins": "SAMEORIGIN"
+}
\ No newline at end of file
diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj
index 734313dee..23765ea88 100644
--- a/Kavita.Common/Kavita.Common.csproj
+++ b/Kavita.Common/Kavita.Common.csproj
@@ -4,7 +4,7 @@
- {{t('description')}} -
+