mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Rename PROXY_* options to MEDIA_PROXY_*
This commit is contained in:
parent
ed20771194
commit
c2311e316c
14 changed files with 413 additions and 204 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue