mirror of https://github.com/hunshcn/gh-proxy
Merge pull request #126 from M4nk1n/master
判断 github 链接不为 http(s):// 开头时自动补充 https 前缀pull/124/merge
commit
9b24915abe
2
index.js
2
index.js
|
|
@ -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.search(/^https?:\/\//) !== 0) {
|
||||||
urlStr = 'https://' + urlStr
|
urlStr = 'https://' + urlStr
|
||||||
}
|
}
|
||||||
const urlObj = newUrl(urlStr)
|
const urlObj = newUrl(urlStr)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue