Fix crash on no certificate provided
This commit is contained in:
parent
d8d15d8f72
commit
cb9b3ea167
|
@ -57,8 +57,11 @@ impl Request {
|
||||||
)
|
)
|
||||||
.context("Request URI is invalid")?
|
.context("Request URI is invalid")?
|
||||||
.into_owned(),
|
.into_owned(),
|
||||||
headers.get("TLS_CLIENT_HASH").map(hash_decode)
|
match headers.get("TLS_CLIENT_HASH").map(hash_decode) {
|
||||||
.ok_or(anyhow!("Received malformed TLS client hash from upstream. Expected 256 bit hex or b64 encoded"))?,
|
Some(maybe_hash @ Some(_)) => maybe_hash,
|
||||||
|
Some(None) => bail!("Received malformed TLS client hash from upstream. Expected 256 bit hex or b64 encoded"),
|
||||||
|
None => None,
|
||||||
|
},
|
||||||
headers.get("SCRIPT_PATH")
|
headers.get("SCRIPT_PATH")
|
||||||
.or_else(|| headers.get("SCRIPT_NAME"))
|
.or_else(|| headers.get("SCRIPT_NAME"))
|
||||||
.cloned()
|
.cloned()
|
||||||
|
|
Loading…
Reference in a new issue