MM-58275 Ensure image proxy site URL is updated when that changes (#27214)

* MM-58275 Ensure image proxy site URL is updated when that changes

* Check if proxy settings changed using reflection
Этот коммит содержится в:
Harrison Healey
2024-06-04 14:06:37 -04:00
коммит произвёл GitHub
родитель 206ff6e697
Коммит 2bcaa42dc0
6 изменённых файлов: 127 добавлений и 41 удалений

Просмотреть файл

@@ -66,14 +66,13 @@ func TestAtmosCamoBackend_GetImageDirect(t *testing.T) {
defer mock.Close()
proxy := makeTestAtmosCamoProxy()
parsedURL, err := url.Parse(*proxy.ConfigService.Config().ServiceSettings.SiteURL)
parsedURL, err := url.Parse("https://mattermost.example.com")
require.NoError(t, err)
remoteURL, err := url.Parse(mock.URL)
require.NoError(t, err)
backend := &AtmosCamoBackend{
proxy: proxy,
siteURL: parsedURL,
remoteURL: remoteURL,
client: proxy.HTTPService.MakeClient(false),
@@ -177,9 +176,9 @@ func TestGetAtmosCamoImageURL(t *testing.T) {
require.NoError(t, err)
backend := &AtmosCamoBackend{
proxy: makeTestAtmosCamoProxy(),
siteURL: parsedURL,
remoteURL: remoteURL,
siteURL: parsedURL,
remoteURL: remoteURL,
remoteOptions: *makeTestAtmosCamoProxy().ConfigService.Config().ImageProxySettings.RemoteImageProxyOptions,
}
assert.Equal(t, test.Expected, backend.getAtmosCamoImageURL(test.Input))