todo: add http2-only client for h2c case

This commit is contained in:
Jun Kurihara 2023-08-07 22:18:54 +09:00
commit f2c6d738b6
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
5 changed files with 26 additions and 14 deletions

View file

@ -4,8 +4,8 @@ use crate::error::*;
pub enum UpstreamOption {
OverrideHost,
UpgradeInsecureRequests,
ConvertHttpsTo11,
ConvertHttpsTo2,
ForceHttp11Upstream,
ForceHttp2Upstream,
// TODO: Adds more options for heder override
}
impl TryFrom<&str> for UpstreamOption {
@ -14,8 +14,8 @@ impl TryFrom<&str> for UpstreamOption {
match val {
"override_host" => Ok(Self::OverrideHost),
"upgrade_insecure_requests" => Ok(Self::UpgradeInsecureRequests),
"convert_https_to_11" => Ok(Self::ConvertHttpsTo11),
"convert_https_to_2" => Ok(Self::ConvertHttpsTo2),
"force_http11_upstream" => Ok(Self::ForceHttp11Upstream),
"force_http2_upstream" => Ok(Self::ForceHttp2Upstream),
_ => Err(RpxyError::Other(anyhow!("Unsupported header option"))),
}
}