Skip to content

Commit baf4d70

Browse files
committed
fix: resolve admin API URL from current origin
1 parent 74aa747 commit baf4d70

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

‎admin/api.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
putenv('GENERIC_ADMIN_ENABLED=1');
4-
53
define('API_REQUEST_STARTED', microtime(true));
64
define('API_REQUEST_ID', bin2hex(random_bytes(8)));
75
ob_start();

‎admin/assets/admin.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(() => {
22
"use strict";
33
const adminBase = (document.body.dataset.adminBase || "").replace(/\/+$/, ""),
4-
apiUrl = `${adminBase}/api.php`,
4+
apiUrl = `${window.location.origin}${adminBase}/api.php`,
55
content = document.querySelector("#content"),
66
title = document.querySelector("#page-title");
77
const navigation = document.querySelector("#navigation"),

0 commit comments

Comments
 (0)