Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jenny Ryan
ouinet
Commits
ab40a385
Commit
ab40a385
authored
Jun 26, 2020
by
Ivan Vilata-i-Balaguer
Browse files
Fix comparison of `X-Ouinet-Private` value.
The true value is case-insensitive.
parent
8a03f8b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/client.cpp
View file @
ab40a385
...
...
@@ -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.
...
...
src/client.h
View file @
ab40a385
...
...
@@ -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
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment