implement https_only flag
This commit is contained in:
committed by
Martin Algesten
parent
06743da5de
commit
aced0d9b6a
@@ -348,6 +348,11 @@ fn connect_socket(unit: &Unit, hostname: &str, use_pooled: bool) -> Result<(Stre
|
||||
"http" | "https" | "test" => (),
|
||||
scheme => return Err(ErrorKind::UnknownScheme.msg(format!("unknown scheme '{}'", scheme))),
|
||||
};
|
||||
if unit.url.scheme() != "https" && unit.agent.config.https_only {
|
||||
return Err(ErrorKind::InsecureRequestHttpsOnly.msg(format!(
|
||||
"can't perform non https request with https_only set"
|
||||
)));
|
||||
}
|
||||
if use_pooled {
|
||||
let pool = &unit.agent.state.pool;
|
||||
let proxy = &unit.agent.config.proxy;
|
||||
|
||||
Reference in New Issue
Block a user