diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-01-18 15:24:20 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-01-18 15:24:20 +0000 |
commit | a2231b799729238636e4c47100d7771ae50d6195 (patch) | |
tree | fca9304a48ac0d8b16331026d320083c5b46f061 /icespider/fcgi | |
parent | Performance fixes (diff) | |
download | icespider-a2231b799729238636e4c47100d7771ae50d6195.tar.bz2 icespider-a2231b799729238636e4c47100d7771ae50d6195.tar.xz icespider-a2231b799729238636e4c47100d7771ae50d6195.zip |
Helper for testing for HTTPS
Diffstat (limited to 'icespider/fcgi')
-rw-r--r-- | icespider/fcgi/cgiRequestBase.cpp | 7 | ||||
-rw-r--r-- | icespider/fcgi/cgiRequestBase.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/icespider/fcgi/cgiRequestBase.cpp b/icespider/fcgi/cgiRequestBase.cpp index b6d5a77..8e04c07 100644 --- a/icespider/fcgi/cgiRequestBase.cpp +++ b/icespider/fcgi/cgiRequestBase.cpp @@ -19,6 +19,7 @@ namespace IceSpider { constexpr std::string_view amp("&"); constexpr std::string_view semi("; "); constexpr std::string_view HEADER_PREFIX("HTTP_"); + constexpr std::string_view HTTPS("HTTPS"); CGI_CONST(REDIRECT_URL); CGI_CONST(SCRIPT_NAME); CGI_CONST(QUERY_STRING); @@ -165,6 +166,12 @@ namespace IceSpider { return optionalLookup(key, envmap); } + bool + CgiRequestBase::isSecure() const + { + return envmap.find(HTTPS) != envmap.end(); + } + OptionalString CgiRequestBase::getHeaderParam(const std::string_view & key) const { diff --git a/icespider/fcgi/cgiRequestBase.h b/icespider/fcgi/cgiRequestBase.h index 88bc473..f235acf 100644 --- a/icespider/fcgi/cgiRequestBase.h +++ b/icespider/fcgi/cgiRequestBase.h @@ -24,6 +24,7 @@ namespace IceSpider { OptionalString getHeaderParam(const std::string_view & key) const override; OptionalString getCookieParam(const std::string_view & key) const override; OptionalString getEnv(const std::string_view & key) const override; + bool isSecure() const override; void response(short, const std::string_view &) const override; void setHeader(const std::string_view &, const std::string_view &) const override; |