Skip to content

Commit f56fa2a

Browse files
authored
Fix CORS proxy
1 parent ed8195e commit f56fa2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

htmlpreview.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@
8989
var fetchProxy = function (url, options, i) {
9090
var proxy = [
9191
'https://cors-anywhere.herokuapp.com/',
92-
'https://yacdn.org/serve/',
92+
'https://yacdn.org/proxy/',
9393
'https://api.codetabs.com/v1/proxy/?quest='
9494
];
9595
return fetch(proxy[i] + url, options).then(function (res) {
96+
if (!res.ok) throw new Error('Cannot load ' + url + ': ' + res.status + ' ' + res.statusText);
9697
return res.text();
9798
}).catch(function (error) {
9899
if (i === proxy.length - 1)

0 commit comments

Comments
 (0)