Fetch when deployed returns error/html, but locally is fine
Unanswered
Rex posted this in #help-forum
RexOP
for an rss feed: "https://pubs.asahq.org/rss/site_1000005/1000005.xml"
just doing
it's in a server action
just doing
const response = await fetch(rssUrl, {
next: { revalidate: cacheConfig.revalidateInterval },
})it's in a server action
7 Replies
RexOP
i tried
const response = await fetch(rssUrl, {
next: { revalidate: cacheConfig.revalidateInterval },
headers: {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8',
},
})
next: { revalidate: cacheConfig.revalidateInterval },
headers: {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8',
},
})
RexOP
it seems the site somehow stops fetches from vercel servers?
<html><head><script type="text/javascript"><!--
function leastFactor(n) {
if (isNaN(n) || !isFinite(n)) return NaN;
if (typeof phantom !== 'undefined') return 'phantom';
if (typeof module !== 'undefined' && module.exports) return 'node';
if (n==0) return 0;
if (n%1 || n*n<2) return 1;
if (n%2==0) return 2;
if (n%3==0) return 3;
if (n%5==0) return 5;
var m=Math.sqrt(n);
for (var i=7;i<=m;i+=30) {
if (n%i==0) return i;
if (n%(i+4)==0) return i+4;
if (n%(i+6)==0) return i+6;
if (n%(i+10)==0) return i+10;
if (n%(i+12)==0) return i+12;
if (n%(i+16)==0) return i+16;
if (n%(i+22)==0) return i+22;
if (n%(i+24)==0) return i+24;
}
return n;
}
function go() {
var p=1941803698458; var s=882377124; var n;
if ((s >> 2) & 1) p+=/*
*13;
*/316940359*
5;/*
*13;
*/else /* 120886108*
*/p-=/*
*13;
*/364098237*3;/*
else p-=
*/if ((s >> 13) & 1)/* 120886108*
*/p+= 38422471* 14;/*
else p-=
*/else p-=
148371026*/*
p+= */14; if ((s >> 6) & 1)
p+=/*
else p-=
*/104798377*9;/*
*13;
*/else /*
else p-=
*/p-=38644470*/*
p+= */7; if ((s >> 3) & 1)/* 120886108*
*/p+=/*
else p-=
*/103545381*/* 120886108*
*/4;/*
else p-=
*/else p-=/*
*13;
*/466366359*/* 120886108*
*/4;/*
*13;
*/if ((s >> 1) & 1)/* 120886108*
*/p+= 952263891* 2; else /*
p+= */p-=
883030177*/*
p+= */2; p+=2665987394;
n=leastFactor(p);
{ document.cookie="KEY="+n+"*"+p/n+":"+s+":1399396592:1;path=/;";
document.location.reload(true); }
}
//--></script></head>
<body onload="go()">
Loading...
</body>
</html>RexOP
eg
how does feedly get it then :S why is an rss feed avoiding being retrieved