[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - test/WopiTestServer.hpp
Pranav Kant
pranavk at collabora.co.uk
Thu Feb 15 13:18:09 UTC 2018
test/WopiTestServer.hpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 8b83f0a1de17aa9f83ab62179a95a0035c6d3740
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Fri Feb 9 01:14:18 2018 +0530
Unbreak some wopi tests; use fractional fractional iso8601
And we read the "LastModifiedTime" from the JSON payload in PutFile
response, not from the headers. Change that so that wsd now reads the
correct time.
Change-Id: Ic930ef4cfb2744367d04ba460fa1cbeb045b7356
(cherry picked from commit 40a56e31ddc6a470d81a410f102e41938516f043)
Reviewed-on: https://gerrit.libreoffice.org/49758
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/test/WopiTestServer.hpp b/test/WopiTestServer.hpp
index 651fef49..9cac0598 100644
--- a/test/WopiTestServer.hpp
+++ b/test/WopiTestServer.hpp
@@ -112,7 +112,7 @@ protected:
fileInfo->set("UserFriendlyName", "test");
fileInfo->set("UserCanWrite", "true");
fileInfo->set("PostMessageOrigin", "localhost");
- fileInfo->set("LastModifiedTime", Poco::DateTimeFormatter::format(_fileLastModifiedTime, Poco::DateTimeFormat::ISO8601_FORMAT));
+ fileInfo->set("LastModifiedTime", Poco::DateTimeFormatter::format(Poco::DateTime(_fileLastModifiedTime), Poco::DateTimeFormat::ISO8601_FRAC_FORMAT));
fileInfo->set("EnableOwnerTermination", "true");
std::ostringstream jsonStream;
@@ -190,6 +190,7 @@ protected:
std::string wopiTimestamp = request.get("X-LOOL-WOPI-Timestamp");
if (!wopiTimestamp.empty())
{
+
const std::string fileModifiedTime =
Poco::DateTimeFormatter::format(Poco::DateTime(_fileLastModifiedTime),
Poco::DateTimeFormat::ISO8601_FRAC_FORMAT);
@@ -199,7 +200,7 @@ protected:
oss << "HTTP/1.1 409 Conflict\r\n"
<< "User-Agent: " << WOPI_AGENT_STRING << "\r\n"
<< "\r\n"
- << "{\"LOOLStatusCode\":" << LOOLStatusCode::DocChanged << "}";
+ << "{\"LOOLStatusCode\":" << static_cast<int>(LOOLStatusCode::DocChanged) << "}";
socket->send(oss.str());
socket->shutdown();
@@ -216,9 +217,9 @@ protected:
std::ostringstream oss;
oss << "HTTP/1.1 200 OK\r\n"
- << "Last-Modified: " << Poco::DateTimeFormatter::format(_fileLastModifiedTime, Poco::DateTimeFormat::HTTP_FORMAT) << "\r\n"
<< "User-Agent: " << WOPI_AGENT_STRING << "\r\n"
- << "\r\n";
+ << "\r\n"
+ << "{\"LastModifiedTime\": \"" << Poco::DateTimeFormatter::format(_fileLastModifiedTime, Poco::DateTimeFormat::ISO8601_FRAC_FORMAT) << "\" }";
socket->send(oss.str());
socket->shutdown();
More information about the Libreoffice-commits
mailing list