2022-06-22 08:44:29 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
|
|
/*
|
2023-10-30 16:58:54 -05:00
|
|
|
* Copyright the Collabora Online contributors.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
2023-11-09 12:23:00 -06:00
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2022-06-22 08:44:29 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "Socket.hpp"
|
|
|
|
|
|
|
|
class ProxyRequestHandler
|
|
|
|
{
|
2022-06-22 11:04:11 -05:00
|
|
|
public:
|
|
|
|
static void handleRequest(const std::string& relPath,
|
2022-07-05 07:03:14 -05:00
|
|
|
const std::shared_ptr<StreamSocket>& socket,
|
|
|
|
const std::string& serverUri);
|
|
|
|
static std::string getProxyRatingServer() { return ProxyRatingServer; }
|
2022-06-22 11:04:11 -05:00
|
|
|
|
|
|
|
private:
|
2022-06-22 09:09:12 -05:00
|
|
|
static std::chrono::system_clock::time_point MaxAge;
|
2022-07-05 07:03:14 -05:00
|
|
|
static constexpr auto ProxyRatingServer = "https://rating.collaboraonline.com";
|
2022-06-23 10:35:36 -05:00
|
|
|
static std::unordered_map<std::string, std::shared_ptr<http::Response>> CacheFileHash;
|
2022-06-22 08:44:29 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|