diff --git a/cors/index.js b/cors/index.js index 19a5c95..c8e6571 100644 --- a/cors/index.js +++ b/cors/index.js @@ -90,6 +90,7 @@ async function handleRequest(event) { fp.headers[key] = value; } } + if (config.dropReferer && url.includes('.sinaimg.cn/')) fp.headers['referer'] = 'https://weibo.com/'; // 是否带 body if (["POST", "PUT", "PATCH", "DELETE"].indexOf(request.method) >= 0) { diff --git a/pages/_worker.js b/pages/_worker.js index 0d49c3d..75d12c8 100644 --- a/pages/_worker.js +++ b/pages/_worker.js @@ -86,6 +86,7 @@ async function handleRequest(request) { fp.headers[key] = value; } } + if (config.dropReferer && url.includes('.sinaimg.cn/')) fp.headers['referer'] = 'https://weibo.com/'; // 是否带 body if (["POST", "PUT", "PATCH", "DELETE"].indexOf(request.method) >= 0) {