summaryrefslogtreecommitdiffstats
path: root/wsd/Storage.hpp
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2021-01-10 12:20:00 -0500
committerAshod Nakashian <Ashod@users.noreply.github.com>2021-02-20 16:47:17 -0500
commitf5f1a64591b8c4c1faf2119d0713ac05cc298b96 (patch)
tree0fe17a42c52b47a61fb61018a92c77cda168d144 /wsd/Storage.hpp
parentwsd: set the result of saving and mark the response time (diff)
downloadonline-f5f1a64591b8c4c1faf2119d0713ac05cc298b96.tar.gz
online-f5f1a64591b8c4c1faf2119d0713ac05cc298b96.zip
wsd: storage: download with http::Request and http::Session
Change-Id: I11e553fd65faf4d33c51f9b6e7e6e256fd87ba05 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Diffstat (limited to 'wsd/Storage.hpp')
-rw-r--r--wsd/Storage.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index 46178e0f08..cffdf74d7b 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -22,6 +22,7 @@
#include "Log.hpp"
#include "Util.hpp"
#include <common/Authorization.hpp>
+#include <net/HttpRequest.hpp>
namespace Poco
{
@@ -258,6 +259,7 @@ public:
static bool allowedWopiHost(const std::string& host);
static Poco::Net::HTTPClientSession* getHTTPClientSession(const Poco::URI& uri);
+ static std::shared_ptr<http::Session> getHttpSession(const Poco::URI& uri);
protected:
@@ -534,6 +536,10 @@ private:
void initHttpRequest(Poco::Net::HTTPRequest& request, const Poco::URI& uri,
const Authorization& auth, const std::string& cookies) const;
+ /// Create an http::Request with the common headers.
+ http::Request initHttpRequest(const Poco::URI& uri, const Authorization& auth,
+ const std::string& cookies) const;
+
/// Download the document from the given URI.
/// Does not add authorization tokens or any other logic.
std::string downloadDocument(const Poco::URI& uriObject, const std::string& uriAnonym,