Skip to content

Commit d7d56c0

Browse files
Bug fix, closes bia-pain-bache#1123
1 parent 131393b commit d7d56c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function init(request: Request, env: Env) {
113113
globalThis.globalConfig = {
114114
userID: UUID,
115115
TrPass: TR_PASS,
116-
pathName: decodeURI(pathname),
116+
pathName: decodeURIComponent(pathname),
117117
fallbackDomain: FALLBACK || 'speed.cloudflare.com',
118118
dohURL: DOH_URL || 'https://cloudflare-dns.com/dns-query'
119119
};
@@ -139,7 +139,7 @@ export function initHttp(request: Request, env: any) {
139139
const { UUID, TR_PASS, SUB_PATH, kv } = env;
140140
const { pathname, origin, searchParams, hostname } = new URL(request.url);
141141

142-
if (!['/secrets', '/favicon.ico'].includes(decodeURI(pathname))) {
142+
if (!['/secrets', '/favicon.ico'].includes(decodeURIComponent(pathname))) {
143143
if (!UUID || !TR_PASS) throw new Error(`Please set ${_VL_CAP_} UUID and ${_TR_CAP_} password first. Visit <a href="${origin}/secrets" target="_blank">here</a> to generate them.`, { cause: "init" });
144144
if (!isValidUUID(UUID)) throw new Error(`Invalid UUID: ${UUID}`, { cause: "init" });
145145
if (typeof kv !== 'object') throw new Error(`KV Dataset is not properly set! Please refer to <a href="${_website_}" target="_blank">tutorials</a>.`, { cause: "init" });

0 commit comments

Comments
 (0)