Update index.js

兼容 raw/gist 链接添加 https 前缀
pull/125/head
Mankin 8 months ago committed by GitHub
parent af06c85c3c
commit c0446055aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -129,7 +129,7 @@ function httpHandler(req, pathname) {
if (!flag) { if (!flag) {
return new Response("blocked", {status: 403}) return new Response("blocked", {status: 403})
} }
if (urlStr.startsWith('github')) { if (urlStr.startsWith('github') || urlStr.startsWith('raw.github') || urlStr.startsWith('gist.github')) {
urlStr = 'https://' + urlStr urlStr = 'https://' + urlStr
} }
const urlObj = newUrl(urlStr) const urlObj = newUrl(urlStr)

Loading…
Cancel
Save