Merge branch 'release-4.7' into icu669
Этот коммит содержится в:
10
app/post.go
10
app/post.go
@@ -922,6 +922,10 @@ func (a *App) imageProxyConfig() (proxyType, proxyURL, options, siteURL string)
|
||||
proxyURL += "/"
|
||||
}
|
||||
|
||||
if siteURL == "" || siteURL[len(siteURL)-1] != '/' {
|
||||
siteURL += "/"
|
||||
}
|
||||
|
||||
if cfg.ServiceSettings.ImageProxyOptions != nil {
|
||||
options = *cfg.ServiceSettings.ImageProxyOptions
|
||||
}
|
||||
@@ -936,14 +940,10 @@ func (a *App) ImageProxyAdder() func(string) string {
|
||||
}
|
||||
|
||||
return func(url string) string {
|
||||
if url == "" || strings.HasPrefix(url, proxyURL) {
|
||||
if url == "" || url[0] == '/' || strings.HasPrefix(url, siteURL) || strings.HasPrefix(url, proxyURL) {
|
||||
return url
|
||||
}
|
||||
|
||||
if url[0] == '/' {
|
||||
url = siteURL + url
|
||||
}
|
||||
|
||||
switch proxyType {
|
||||
case "atmos/camo":
|
||||
mac := hmac.New(sha1.New, []byte(options))
|
||||
|
||||
Ссылка в новой задаче
Block a user