Skip to content

Commit

Permalink
feat: add referer for sinaimg
Browse files Browse the repository at this point in the history
  • Loading branch information
Rongronggg9 committed Jan 3, 2023
1 parent 8258996 commit 8a24955
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions pages/_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8a24955

Please sign in to comment.