From e066f896efaa28241f4fa685a63ae0c05ea42fbe Mon Sep 17 00:00:00 2001 From: lol768 Date: Thu, 29 Sep 2016 20:45:40 +0100 Subject: [PATCH] Add integration test for module CSRF overrides --- test/integration/main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/integration/main.cpp b/test/integration/main.cpp index 23656ae3..ccf8ae33 100644 --- a/test/integration/main.cpp +++ b/test/integration/main.cpp @@ -1965,4 +1965,21 @@ TEST_F(ZNCTest, KeepNickModule) { ":Unable to obtain nick user: Nope :-P, #error"); } +TEST_F(ZNCTest, ModuleCSRFOverride) { + auto znc = Run(); + Z; + auto ircd = ConnectIRCd(); + Z; + auto client = LoginClient(); + Z; + client.Write("znc loadmod samplewebapi"); + Z; + auto request = QNetworkRequest(QUrl("http://127.0.0.1:12345/mods/global/samplewebapi/")); + auto reply = HttpPost(request, { + {"text", "ipsum"} + })->readAll().toStdString(); + Z; + EXPECT_THAT(reply, HasSubstr("ipsum")); +} + } // namespace