mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Make sure PROXY_IMAGES option is backward compatible
Bug introduced in PR #1610 Fixes #1753
This commit is contained in:
parent
8b6dd3e599
commit
aa9b18a8d6
2 changed files with 68 additions and 2 deletions
|
@ -141,7 +141,6 @@ func (p *Parser) parseLines(lines []string) (err error) {
|
|||
// kept for compatibility purpose
|
||||
case "PROXY_IMAGES":
|
||||
p.opts.proxyOption = parseString(value, defaultProxyOption)
|
||||
p.opts.proxyMediaTypes = append(p.opts.proxyMediaTypes, "image")
|
||||
case "PROXY_HTTP_CLIENT_TIMEOUT":
|
||||
p.opts.proxyHTTPClientTimeout = parseInt(value, defaultProxyHTTPClientTimeout)
|
||||
case "PROXY_OPTION":
|
||||
|
@ -297,9 +296,16 @@ func parseStringList(value string, fallback []string) []string {
|
|||
}
|
||||
|
||||
var strList []string
|
||||
strMap := make(map[string]bool)
|
||||
|
||||
items := strings.Split(value, ",")
|
||||
for _, item := range items {
|
||||
strList = append(strList, strings.TrimSpace(item))
|
||||
itemValue := strings.TrimSpace(item)
|
||||
|
||||
if _, found := strMap[itemValue]; !found {
|
||||
strMap[itemValue] = true
|
||||
strList = append(strList, itemValue)
|
||||
}
|
||||
}
|
||||
|
||||
return strList
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue