From 7ed712f938588491da35b1d04b7f44700975c70b Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Wed, 11 Jul 2018 12:58:16 +0200 Subject: Restore config after finisht the test case (#9085) --- api4/post_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'api4/post_test.go') diff --git a/api4/post_test.go b/api4/post_test.go index 63d71b5bd..720fdc410 100644 --- a/api4/post_test.go +++ b/api4/post_test.go @@ -170,6 +170,15 @@ func testCreatePostWithOutgoingHook( team := th.BasicTeam channel := th.BasicChannel + enableOutgoingWebhooks := th.App.Config().ServiceSettings.EnableOutgoingWebhooks + allowedUntrustedInternalConnections := th.App.Config().ServiceSettings.AllowedUntrustedInternalConnections + defer func() { + th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = enableOutgoingWebhooks }) + th.App.UpdateConfig(func(cfg *model.Config) { + cfg.ServiceSettings.AllowedUntrustedInternalConnections = allowedUntrustedInternalConnections + }) + }() + th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableOutgoingWebhooks = true }) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.AllowedUntrustedInternalConnections = "localhost 127.0.0.1" -- cgit v1.2.3-1-g7c22