MM-14574 Intercept log messages from local image proxy (#10668)
* MM-14574 Switch willnorris/imageproxy to fork * MM-14574 Intercept log messages from local image proxy * Revert "MM-14574 Switch willnorris/imageproxy to fork" This reverts commit 046ab5c4216a5c6fee5bf8e2e0cceb1afffa6747. * Update willnorris/imageproxy
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7c7ff93d97
Коммит
cbcfef25e5
@@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/mattermost/mattermost-server/mlog"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/services/configservice"
|
||||
"github.com/mattermost/mattermost-server/services/httpservice"
|
||||
@@ -24,6 +25,8 @@ type ImageProxy struct {
|
||||
|
||||
HTTPService httpservice.HTTPService
|
||||
|
||||
Logger *mlog.Logger
|
||||
|
||||
lock sync.RWMutex
|
||||
backend ImageProxyBackend
|
||||
}
|
||||
@@ -45,10 +48,11 @@ type ImageProxyBackend interface {
|
||||
GetUnproxiedImageURL(proxiedURL string) string
|
||||
}
|
||||
|
||||
func MakeImageProxy(configService configservice.ConfigService, httpService httpservice.HTTPService) *ImageProxy {
|
||||
func MakeImageProxy(configService configservice.ConfigService, httpService httpservice.HTTPService, logger *mlog.Logger) *ImageProxy {
|
||||
proxy := &ImageProxy{
|
||||
ConfigService: configService,
|
||||
HTTPService: httpService,
|
||||
Logger: logger,
|
||||
}
|
||||
|
||||
proxy.configListenerId = proxy.ConfigService.AddConfigListener(proxy.OnConfigChange)
|
||||
|
||||
Ссылка в новой задаче
Block a user