support upgrade-insecure-requests option
This commit is contained in:
parent
954a1993a9
commit
1a80e405b5
8 changed files with 112 additions and 29 deletions
|
|
@ -3,6 +3,7 @@ use crate::error::*;
|
|||
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
|
||||
pub enum UpstreamOption {
|
||||
OverrideHost,
|
||||
UpgradeInsecureRequests,
|
||||
// TODO: Adds more options for heder override
|
||||
}
|
||||
impl TryFrom<&str> for UpstreamOption {
|
||||
|
|
@ -10,6 +11,7 @@ impl TryFrom<&str> for UpstreamOption {
|
|||
fn try_from(val: &str) -> Result<Self> {
|
||||
match val {
|
||||
"override_host" => Ok(Self::OverrideHost),
|
||||
"upgrade_insecure_requests" => Ok(Self::UpgradeInsecureRequests),
|
||||
_ => Err(anyhow!("Unsupported header option")),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue