wip fix
This commit is contained in:
parent
8a74cbf127
commit
f025013315
File diff suppressed because one or more lines are too long
|
|
@ -40,13 +40,8 @@ const serverMain = () => ({
|
|||
delete require.cache[server_src_path];
|
||||
const svr = require(server_src_path);
|
||||
|
||||
if (svr && svr.server) {
|
||||
if (typeof svr.server === "function") {
|
||||
this.handler[site_id] = await svr.server(site_id);
|
||||
} else {
|
||||
this.handler[site_id] = svr.server;
|
||||
}
|
||||
|
||||
if (svr && typeof svr.server === 'object') {
|
||||
this.handler[site_id] = svr.server;
|
||||
this.handler[site_id].site_id = site_id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,12 +52,13 @@ export const fetchViaProxy = async (
|
|||
const cur_url = new URL(location.href);
|
||||
let final_url = "";
|
||||
|
||||
if (to_url.host === cur_url.host || typeof g.server_hook === 'function') {
|
||||
if (to_url.host === cur_url.host ||
|
||||
(!!g && typeof g.server_hook === 'function')) {
|
||||
final_url = to_url.toString();
|
||||
} else {
|
||||
final_url = `${cur_url.protocol}//${cur_url.host
|
||||
}/_proxy/${encodeURIComponent(to_url.toString())}`;
|
||||
}
|
||||
}
|
||||
|
||||
if (final_url) {
|
||||
if (uploadProgress) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue