Fix: s.pximg.net didn't get proxied
This commit is contained in:
parent
b58af8d73f
commit
65b45856bf
6
main.go
6
main.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"pixivfe/views"
|
"pixivfe/views"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
@ -32,6 +33,11 @@ func setupRouter() *gin.Engine {
|
||||||
},
|
},
|
||||||
|
|
||||||
"proxyImage": func(url string) string {
|
"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`)
|
regex := regexp.MustCompile(`.*?pximg\.net`)
|
||||||
proxy := "https://" + configs.Configs.ImageProxyServer
|
proxy := "https://" + configs.Configs.ImageProxyServer
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue