diff options
author | 2023-08-13 19:09:01 -0700 | |
---|---|---|
committer | 2023-08-13 19:57:04 -0700 | |
commit | e5d9f2f5a05453043ed29c79f3f1a8865f26d99d (patch) | |
tree | 86e6888a2c02d3daec4f2b3f0c2d633db96ea063 /internal/proxy/media_proxy.go | |
parent | 9f465fd70db9368e87e2dac77f4ea2d2a27c7c14 (diff) | |
download | v2-e5d9f2f5a05453043ed29c79f3f1a8865f26d99d.tar.gz v2-e5d9f2f5a05453043ed29c79f3f1a8865f26d99d.tar.zst v2-e5d9f2f5a05453043ed29c79f3f1a8865f26d99d.zip |
Rename internal url package to avoid overlap with net/url
Diffstat (limited to 'internal/proxy/media_proxy.go')
-rw-r--r-- | internal/proxy/media_proxy.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/proxy/media_proxy.go b/internal/proxy/media_proxy.go index 6fc7a92e..14de7d7e 100644 --- a/internal/proxy/media_proxy.go +++ b/internal/proxy/media_proxy.go @@ -8,7 +8,7 @@ import ( "miniflux.app/v2/internal/config" "miniflux.app/v2/internal/reader/sanitizer" - "miniflux.app/v2/internal/url" + "miniflux.app/v2/internal/urllib" "github.com/PuerkitoBio/goquery" "github.com/gorilla/mux" @@ -45,7 +45,7 @@ func genericProxyRewriter(router *mux.Router, proxifyFunction urlProxyRewriter, case "image": doc.Find("img").Each(func(i int, img *goquery.Selection) { if srcAttrValue, ok := img.Attr("src"); ok { - if !isDataURL(srcAttrValue) && (proxyOption == "all" || !url.IsHTTPS(srcAttrValue)) { + if !isDataURL(srcAttrValue) && (proxyOption == "all" || !urllib.IsHTTPS(srcAttrValue)) { img.SetAttr("src", proxifyFunction(router, srcAttrValue)) } } @@ -64,7 +64,7 @@ func genericProxyRewriter(router *mux.Router, proxifyFunction urlProxyRewriter, case "audio": doc.Find("audio").Each(func(i int, audio *goquery.Selection) { if srcAttrValue, ok := audio.Attr("src"); ok { - if !isDataURL(srcAttrValue) && (proxyOption == "all" || !url.IsHTTPS(srcAttrValue)) { + if !isDataURL(srcAttrValue) && (proxyOption == "all" || !urllib.IsHTTPS(srcAttrValue)) { audio.SetAttr("src", proxifyFunction(router, srcAttrValue)) } } @@ -72,7 +72,7 @@ func genericProxyRewriter(router *mux.Router, proxifyFunction urlProxyRewriter, doc.Find("audio source").Each(func(i int, sourceElement *goquery.Selection) { if srcAttrValue, ok := sourceElement.Attr("src"); ok { - if !isDataURL(srcAttrValue) && (proxyOption == "all" || !url.IsHTTPS(srcAttrValue)) { + if !isDataURL(srcAttrValue) && (proxyOption == "all" || !urllib.IsHTTPS(srcAttrValue)) { sourceElement.SetAttr("src", proxifyFunction(router, srcAttrValue)) } } @@ -81,7 +81,7 @@ func genericProxyRewriter(router *mux.Router, proxifyFunction urlProxyRewriter, case "video": doc.Find("video").Each(func(i int, video *goquery.Selection) { if srcAttrValue, ok := video.Attr("src"); ok { - if !isDataURL(srcAttrValue) && (proxyOption == "all" || !url.IsHTTPS(srcAttrValue)) { + if !isDataURL(srcAttrValue) && (proxyOption == "all" || !urllib.IsHTTPS(srcAttrValue)) { video.SetAttr("src", proxifyFunction(router, srcAttrValue)) } } @@ -89,7 +89,7 @@ func genericProxyRewriter(router *mux.Router, proxifyFunction urlProxyRewriter, doc.Find("video source").Each(func(i int, sourceElement *goquery.Selection) { if srcAttrValue, ok := sourceElement.Attr("src"); ok { - if !isDataURL(srcAttrValue) && (proxyOption == "all" || !url.IsHTTPS(srcAttrValue)) { + if !isDataURL(srcAttrValue) && (proxyOption == "all" || !urllib.IsHTTPS(srcAttrValue)) { sourceElement.SetAttr("src", proxifyFunction(router, srcAttrValue)) } } @@ -109,7 +109,7 @@ func proxifySourceSet(element *goquery.Selection, router *mux.Router, proxifyFun imageCandidates := sanitizer.ParseSrcSetAttribute(srcsetAttrValue) for _, imageCandidate := range imageCandidates { - if !isDataURL(imageCandidate.ImageURL) && (proxyOption == "all" || !url.IsHTTPS(imageCandidate.ImageURL)) { + if !isDataURL(imageCandidate.ImageURL) && (proxyOption == "all" || !urllib.IsHTTPS(imageCandidate.ImageURL)) { imageCandidate.ImageURL = proxifyFunction(router, imageCandidate.ImageURL) } } |