Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c97c3d9

Browse files
committed
图片获取加上 http
1 parent 6c5d18f commit c97c3d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/logic/uploader.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ func (this *UploaderLogic) TransferUrl(ctx context.Context, origUrl string, pref
187187
return origUrl, errors.New("origin image is empty or is " + WebsiteSetting.Domain)
188188
}
189189

190+
if !strings.HasPrefix(origUrl, "http") {
191+
origUrl = "https:"+origUrl
192+
}
193+
190194
resp, err := http.Get(origUrl)
191195
if err != nil {
192196
return origUrl, errors.New("获取图片失败")

0 commit comments

Comments
 (0)