This commit is contained in:
t3chn0m4g3
2023-04-25 17:47:44 +00:00
parent ff7c368c7f
commit a08a475f57
6 changed files with 16 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -5,7 +5,7 @@
// Print the first List
const isLinkAvailable = async (link) => {
try {
const response = await fetch(link, { method: 'HEAD', redirect: 'manual' });
const response = await fetch(link, { method: 'HEAD', mode: 'no-cors' });
if (response.ok) {
// The link is available
return true;
@ -13,7 +13,7 @@ const isLinkAvailable = async (link) => {
// The link is a redirect, follow the redirect and check the final location
const newLocation = response.headers.get('Location');
if (newLocation) {
const newResponse = await fetch(newLocation, { method: 'HEAD' });
const newResponse = await fetch(newLocation, { method: 'HEAD', mode: 'no-cors' });
if (newResponse.ok) {
// The final location is available
return true;