diff options
author | 2024-03-20 20:59:09 -0700 | |
---|---|---|
committer | 2024-03-20 21:28:28 -0700 | |
commit | c2311e316c6f7ca109531cb3ad55ada19772800a (patch) | |
tree | 405ab94e57908a589f1871c32b956ed17a77a9fb /internal/template/functions.go | |
parent | ed2077119491bcc198ae84df5b1b1ed6f13f78f1 (diff) | |
download | v2-c2311e316c6f7ca109531cb3ad55ada19772800a.tar.gz v2-c2311e316c6f7ca109531cb3ad55ada19772800a.tar.zst v2-c2311e316c6f7ca109531cb3ad55ada19772800a.zip |
Rename PROXY_* options to MEDIA_PROXY_*
Diffstat (limited to 'internal/template/functions.go')
-rw-r--r-- | internal/template/functions.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/template/functions.go b/internal/template/functions.go index f8aa2bbd..54e787cf 100644 --- a/internal/template/functions.go +++ b/internal/template/functions.go @@ -16,8 +16,8 @@ import ( "miniflux.app/v2/internal/crypto" "miniflux.app/v2/internal/http/route" "miniflux.app/v2/internal/locale" + "miniflux.app/v2/internal/mediaproxy" "miniflux.app/v2/internal/model" - "miniflux.app/v2/internal/proxy" "miniflux.app/v2/internal/timezone" "miniflux.app/v2/internal/urllib" @@ -57,19 +57,19 @@ func (f *funcMap) Map() template.FuncMap { return template.HTML(str) }, "proxyFilter": func(data string) string { - return proxy.ProxyRewriter(f.router, data) + return mediaproxy.RewriteDocumentWithRelativeProxyURL(f.router, data) }, "proxyURL": func(link string) string { - proxyOption := config.Opts.ProxyOption() + mediaProxyMode := config.Opts.MediaProxyMode() - if proxyOption == "all" || (proxyOption != "none" && !urllib.IsHTTPS(link)) { - return proxy.ProxifyURL(f.router, link) + if mediaProxyMode == "all" || (mediaProxyMode != "none" && !urllib.IsHTTPS(link)) { + return mediaproxy.ProxifyRelativeURL(f.router, link) } return link }, "mustBeProxyfied": func(mediaType string) bool { - return slices.Contains(config.Opts.ProxyMediaTypes(), mediaType) + return slices.Contains(config.Opts.MediaProxyResourceTypes(), mediaType) }, "domain": urllib.Domain, "hasPrefix": strings.HasPrefix, |