mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
Update worker.js
This commit is contained in:
parent
a639b5700b
commit
3ac420ef6f
1 changed files with 10 additions and 9 deletions
19
worker.js
19
worker.js
|
@ -9,7 +9,8 @@ const allowedDomains = [
|
||||||
'https://gomo.to',
|
'https://gomo.to',
|
||||||
'https://lookmovie.io',
|
'https://lookmovie.io',
|
||||||
'https://gomoplayer.com',
|
'https://gomoplayer.com',
|
||||||
'https://api.opensubtitles.org'
|
'https://api.opensubtitles.org',
|
||||||
|
'https://www.vmovee.watch'
|
||||||
];
|
];
|
||||||
|
|
||||||
async function handleRequest(request, destinationUrl, iteration = 0) {
|
async function handleRequest(request, destinationUrl, iteration = 0) {
|
||||||
|
@ -48,7 +49,7 @@ async function handleRequest(request, destinationUrl, iteration = 0) {
|
||||||
|
|
||||||
// Set CORS headers
|
// Set CORS headers
|
||||||
response.headers.set("Access-Control-Allow-Origin", '*');
|
response.headers.set("Access-Control-Allow-Origin", '*');
|
||||||
response.headers.set('Access-Control-Expose-Headers', 'PHPSESSID');
|
response.headers.set('Access-Control-Expose-Headers', '*');
|
||||||
|
|
||||||
// Get and set PHPSESSID cookie
|
// Get and set PHPSESSID cookie
|
||||||
const cookies = response.headers.get('Set-Cookie');
|
const cookies = response.headers.get('Set-Cookie');
|
||||||
|
@ -112,13 +113,13 @@ addEventListener("fetch", event => {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (!allowedDomains.find(domain => destinationUrl.startsWith(domain))) {
|
// else if (!allowedDomains.find(domain => destinationUrl.startsWith(domain))) {
|
||||||
event.respondWith(
|
// event.respondWith(
|
||||||
new Response('404 Not Found', {
|
// new Response('404 Not Found', {
|
||||||
status: 404,
|
// status: 404,
|
||||||
}),
|
// }),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
else if (request.method === "GET" || request.method === "HEAD" || request.method === "POST") {
|
else if (request.method === "GET" || request.method === "HEAD" || request.method === "POST") {
|
||||||
// Handle request
|
// Handle request
|
||||||
event.respondWith(handleRequest(request, destinationUrl));
|
event.respondWith(handleRequest(request, destinationUrl));
|
||||||
|
|
Loading…
Reference in a new issue