Files
pixivnow/.wrangler/tmp/bundle-gjEixd/checked-fetch.js
JuLuogo bc351f5d48 fix(wrangler): 更新图片代理域名配置并清理临时文件
更新wrangler.toml中的图片代理域名配置,从pixiv.re更改为0721030.xyz域名
清理并重建.wrangler/tmp目录下的中间件和检查fetch相关临时文件
2025-10-08 16:29:27 +08:00

31 lines
833 B
JavaScript

const urls = new Set();
function checkURL(request, init) {
const url =
request instanceof URL
? request
: new URL(
(typeof request === "string"
? new Request(request, init)
: request
).url
);
if (url.port && url.port !== "443" && url.protocol === "https:") {
if (!urls.has(url.toString())) {
urls.add(url.toString());
console.warn(
`WARNING: known issue with \`fetch()\` requests to custom HTTPS ports in published Workers:\n` +
` - ${url.toString()} - the custom port will be ignored when the Worker is published using the \`wrangler deploy\` command.\n`
);
}
}
}
globalThis.fetch = new Proxy(globalThis.fetch, {
apply(target, thisArg, argArray) {
const [request, init] = argArray;
checkURL(request, init);
return Reflect.apply(target, thisArg, argArray);
},
});