Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
WildXBird committed Aug 7, 2021
1 parent e5b5288 commit 6fffd0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion workers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ addEventListener("fetch", (event) => {
let proxy = function (targetUrl, origin) {
return new Promise((resolve, reject) => {
console.log("targetUrl", targetUrl)
let AccessControlAllowOrigin = origin ? { "Access-Control-Allow-Origin": origin } : {}
let AccessControlAllowOrigin = origin ? {
"Access-Control-Allow-Origin": origin,
"Access-Control-Allow-Headers": "*",
"Access-Control-Allow-Method": "*",
} : {}
fetch(targetUrl).then((data) => {
data.arrayBuffer().then((bodyArrayBuffer) => {
var uint8View = new Uint8Array(bodyArrayBuffer);
Expand Down

0 comments on commit 6fffd0a

Please sign in to comment.