From 3db2e359a5085dc9afa4e1c36e402f281a15a127 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 28 Jun 2021 14:04:22 +0200 Subject: HTTP 302 - updates after review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iaac4384385e05f33472b6678422b4a444319b59c Signed-off-by: Szymon Kłos --- test/UnitWOPIHttpRedirectLoop.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/UnitWOPIHttpRedirectLoop.cpp b/test/UnitWOPIHttpRedirectLoop.cpp index 70eca10e00..9b7d6f96e6 100644 --- a/test/UnitWOPIHttpRedirectLoop.cpp +++ b/test/UnitWOPIHttpRedirectLoop.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include @@ -52,22 +53,25 @@ public: assertCheckFileInfoRequest(request); - LOK_ASSERT_MESSAGE("It is expected to stop requesting after 21 redirections", fileId <= 22); + std::string sExpectedMessage = "It is expected to stop requesting after " + std::to_string(RedirectionLimit) + " redirections"; + LOK_ASSERT_MESSAGE(sExpectedMessage, fileId <= RedirectionLimit + 1); LOK_ASSERT_MESSAGE("Expected to be in Phase::Load or Phase::Redirected", _phase == Phase::Load || _phase == Phase::Redirected); _phase = Phase::Redirected; - if (fileId == 22) + if (fileId == RedirectionLimit + 1) _phase = Phase::Polling; std::ostringstream oss; oss << "HTTP/1.1 302 Found\r\n" - "Location: " << helpers::getTestServerURI() << redirectUri << fileId++ << "?" << params << "\r\n" + "Location: " << helpers::getTestServerURI() << redirectUri << fileId << "?" << params << "\r\n" "\r\n"; socket->send(oss.str()); socket->shutdown(); + fileId++; + return true; } -- cgit