Commit ab40a385 authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Fix comparison of `X-Ouinet-Private` value.

The true value is case-insensitive.
parent 8a03f8b6
......@@ -14,6 +14,7 @@
#include <boost/range/adaptor/filtered.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/adaptor/indexed.hpp>
#include <boost/regex.hpp>
#include <iostream>
#include <cstdlib> // for atexit()
......@@ -89,6 +90,9 @@ static const fs::path OUINET_CA_CERT_FILE = "ssl-ca-cert.pem";
static const fs::path OUINET_CA_KEY_FILE = "ssl-ca-key.pem";
static const fs::path OUINET_CA_DH_FILE = "ssl-ca-dh.pem";
// Flags for normal, case-insensitive regular expression.
static const auto rx_icase = boost::regex::normal | boost::regex::icase;
static bool log_transactions() {
return logger.get_threshold() <= DEBUG
|| logger.get_log_file() != nullptr;
......@@ -1778,7 +1782,8 @@ void Client::State::serve_request( GenericStream&& con
Match( reqexpr::from_regex(method_getter, "HEAD")
, nocache_request_config),
Match( reqexpr::from_regex(x_private_getter, "True")
Match( reqexpr::from_regex( x_private_getter
, boost::regex(http_::request_private_true, rx_icase))
, nocache_request_config),
// Disable cache and always go to proxy for this site.
......
......@@ -21,7 +21,7 @@ static const std::string request_group_hdr = header_prefix + "Group";
// instructs the client to avoid request mechanisms that
// would reveal the request or the associated response to other users.
static const std::string request_private_hdr = header_prefix + "Private";
static const std::string request_private_true = "true";
static const std::string request_private_true = "true"; // case insensitive
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment