Switching redirect_location route to use httpservice client and adding caching. (#10118)

Этот коммит содержится в:
Christopher Speller
2019-01-27 18:24:46 -08:00
коммит произвёл GitHub
родитель b890f8d007
Коммит ce2c7110d3
2 изменённых файлов: 28 добавлений и 14 удалений

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

@@ -751,6 +751,7 @@ func TestRedirectLocation(t *testing.T) {
}()
*th.App.Config().ServiceSettings.EnableLinkPreviews = true
*th.App.Config().ServiceSettings.AllowedUntrustedInternalConnections = "127.0.0.1"
_, resp := th.SystemAdminClient.GetRedirectLocation("https://mattermost.com/", "")
CheckNoError(t, resp)
@@ -760,9 +761,7 @@ func TestRedirectLocation(t *testing.T) {
actual, resp := th.SystemAdminClient.GetRedirectLocation(mockBitlyLink, "")
CheckNoError(t, resp)
if actual != expected {
t.Errorf("Expected %v but got %v.", expected, actual)
}
assert.Equal(t, expected, actual)
*th.App.Config().ServiceSettings.EnableLinkPreviews = false
actual, resp = th.SystemAdminClient.GetRedirectLocation("https://mattermost.com/", "")