From d3319512f484ea021158cc382f763e22aa3b1df8 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 19 May 2017 19:48:31 +0100 Subject: [PATCH] Case-insensitive check for HTTPS=on. --- src/tawashi_implem/cgi_env.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tawashi_implem/cgi_env.cpp b/src/tawashi_implem/cgi_env.cpp index eac8ace..101d5d9 100644 --- a/src/tawashi_implem/cgi_env.cpp +++ b/src/tawashi_implem/cgi_env.cpp @@ -166,7 +166,10 @@ namespace cgi { } bool Env::https() const { - return m_cgi_env[CGIVars::HTTPS] == "on"; + const std::string& val = m_cgi_env[CGIVars::HTTPS]; + return val.size() == 2 and ( + val == "on" or val == "ON" or val == "oN" or val == "On" + ); } uint16_t Env::server_port() const {