diff options
| author | 啊o额iu鱼 <[email protected]> | 2022-05-26 11:07:16 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-26 11:07:16 +0800 |
| commit | d0787a640de80af3d8005c4a23a09f8dd296698a (patch) | |
| tree | 5ddb24eda244d8624d434d8d7e248cc157a58dde /src/api | |
| parent | 7c023029cb218a303dec53921d465f106a37d386 (diff) | |
fix: encode URI for latencyTestUrl
fixes #699
Illegal url splicing may lead to misjudgment of ad block,
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/proxies.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/proxies.ts b/src/api/proxies.ts index ce3266e..6b3e28e 100644 --- a/src/api/proxies.ts +++ b/src/api/proxies.ts @@ -36,7 +36,7 @@ export async function requestDelayForProxy( latencyTestUrl = 'http://www.gstatic.com/generate_204' ) { const { url, init } = getURLAndInit(apiConfig); - const qs = `timeout=5000&url=${latencyTestUrl}`; + const qs = `timeout=5000&url=${encodeURIComponent(latencyTestUrl)}`; const fullURL = `${url}${endpoint}/${encodeURIComponent(name)}/delay?${qs}`; return await fetch(fullURL, init); } |
