drogon
C++14/17-based HTTP application framework
Loading...
Searching...
No Matches
SecureSSLRedirector.h
1
6
7#pragma once
8#include <drogon/exports.h>
9#include <drogon/drogon_callbacks.h>
11#include <regex>
12#include <memory>
13
14namespace drogon
15{
16namespace plugin
17{
49class DROGON_EXPORT SecureSSLRedirector
50 : public drogon::Plugin<SecureSSLRedirector>,
51 public std::enable_shared_from_this<SecureSSLRedirector>
52{
53 public:
54 SecureSSLRedirector()
55 {
56 }
57
60 void initAndStart(const Json::Value &config) override;
61
64 void shutdown() override;
65
66 private:
67 bool redirectingAdvice(const HttpRequestPtr &,
68 std::string &,
69 std::string &) const;
70 bool redirectToSSL(const HttpRequestPtr &,
71 std::string &,
72 std::string &) const;
73
74 std::regex exemptRegex_;
75 bool regexFlag_{false};
76 std::string secureHost_;
77};
78
79} // namespace plugin
80} // namespace drogon
The reflection base class for plugins.
Definition Plugin.h:132
void initAndStart(const Json::Value &config) override
Drogon Test is a minimal effort test framework developed because the major C++ test frameworks doesn'...
Definition Attribute.h:23