修复Hybrid HTTP
This commit is contained in:
@@ -27258,7 +27258,15 @@ const LL = [
|
||||
];
|
||||
const DL = FE.create({
|
||||
baseURL: (function () {
|
||||
const e = window.settings?.base_url || "/";
|
||||
let e = window.settings?.base_url || "/";
|
||||
if (
|
||||
"undefined" != typeof window &&
|
||||
"https:" === window.location?.protocol &&
|
||||
"string" == typeof e &&
|
||||
e.startsWith("http://")
|
||||
) {
|
||||
e = "/";
|
||||
}
|
||||
return e.endsWith("/") ? e + "api/v2" : e + "/api/v2";
|
||||
})(),
|
||||
timeout: 3e4,
|
||||
|
||||
@@ -66,7 +66,9 @@ func AdminAppPage(c *gin.Context) {
|
||||
title := service.MustGetString("app_name", "XBoard") + " Admin"
|
||||
|
||||
settings := map[string]string{
|
||||
"base_url": requestBaseURL(c),
|
||||
// Keep admin API requests same-origin so reverse proxies and HTTPS termination
|
||||
// don't depend on backend protocol/header inference.
|
||||
"base_url": "",
|
||||
"title": title,
|
||||
"version": service.MustGetString("app_version", "1.0.0"),
|
||||
"logo": service.MustGetString("logo", ""),
|
||||
|
||||
Reference in New Issue
Block a user