Fix: s.pximg.net didn't get proxied

This commit is contained in:
VnPower 2023-06-04 11:03:05 +07:00
parent b58af8d73f
commit 65b45856bf
Signed by: vnpower
GPG key ID: 881DE3DEB966106C

View file

@ -6,6 +6,7 @@ import (
"pixivfe/views"
"regexp"
"strconv"
"strings"
"github.com/gin-gonic/gin"
)
@ -32,6 +33,11 @@ func setupRouter() *gin.Engine {
},
"proxyImage": func(url string) string {
if strings.Contains(url, "s.pximg.net") {
// This subdomain didn't get proxied
return url
}
regex := regexp.MustCompile(`.*?pximg\.net`)
proxy := "https://" + configs.Configs.ImageProxyServer