Skip to content

Commit

Permalink
perf: limit proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed May 25, 2024
1 parent c881935 commit f8b58ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export const enhanceFetch = async (
// export snapshot need
return GM_fetch(input, init);
} else if (options?.proxy) {
if (!u.href.startsWith('https://github.com/')) {
store.networkErrorDlgVisible = true;
throw new Error(`proxy is not supported`);
}
const proxyUrl = new URL(`https://proxy.gkd.li`);
proxyUrl.searchParams.set(`proxyUrl`, u.href);
const request = new Request(input, init);
Expand Down

0 comments on commit f8b58ae

Please sign in to comment.