diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/command_test.go | 3 | ||||
-rw-r--r-- | api/post_test.go | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/api/command_test.go b/api/command_test.go index 9e6696d64..dd4180b16 100644 --- a/api/command_test.go +++ b/api/command_test.go @@ -233,10 +233,13 @@ func TestTestCommand(t *testing.T) { channel1 := th.SystemAdminChannel enableCommands := *utils.Cfg.ServiceSettings.EnableCommands + allowedInternalConnections := *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections defer func() { utils.Cfg.ServiceSettings.EnableCommands = &enableCommands + utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = &allowedInternalConnections }() *utils.Cfg.ServiceSettings.EnableCommands = true + *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost" cmd1 := &model.Command{ URL: "http://localhost" + utils.Cfg.ServiceSettings.ListenAddress + model.API_URL_SUFFIX_V3 + "/teams/command_test", diff --git a/api/post_test.go b/api/post_test.go index c7bd7a04c..a48ad4f51 100644 --- a/api/post_test.go +++ b/api/post_test.go @@ -188,10 +188,13 @@ func testCreatePostWithOutgoingHook( channel := th.CreateChannel(Client, team) enableOutgoingHooks := utils.Cfg.ServiceSettings.EnableOutgoingWebhooks + allowedInternalConnections := *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections defer func() { utils.Cfg.ServiceSettings.EnableOutgoingWebhooks = enableOutgoingHooks + utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = &allowedInternalConnections }() utils.Cfg.ServiceSettings.EnableOutgoingWebhooks = true + *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1" var hook *model.OutgoingWebhook var post *model.Post @@ -1359,10 +1362,13 @@ func TestGetOpenGraphMetadata(t *testing.T) { Client := th.BasicClient enableLinkPreviews := *utils.Cfg.ServiceSettings.EnableLinkPreviews + allowedInternalConnections := *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections defer func() { *utils.Cfg.ServiceSettings.EnableLinkPreviews = enableLinkPreviews + utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = &allowedInternalConnections }() *utils.Cfg.ServiceSettings.EnableLinkPreviews = true + *utils.Cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1" ogDataCacheMissCount := 0 |