Merge pull request #700 from AoEiuV020/patch-1

fix: encode URI for latencyTestUrl
This commit is contained in:
Haishan 2022-05-27 19:03:04 +08:00 committed by GitHub
commit e4e0631922
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}