fix: change set-upstream-host as a default option
This commit is contained in:
parent
71293d2bcf
commit
3fcea9a28c
5 changed files with 23 additions and 18 deletions
|
|
@ -1,10 +1,17 @@
|
|||
use crate::error::*;
|
||||
|
||||
/// Options for request message to be sent to upstream.
|
||||
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
|
||||
pub enum UpstreamOption {
|
||||
/// Keep original host header, which is prioritized over SetUpstreamHost
|
||||
KeepOriginalHost,
|
||||
/// Overwrite host header with upstream hostname
|
||||
SetUpstreamHost,
|
||||
/// Add upgrade-insecure-requests header
|
||||
UpgradeInsecureRequests,
|
||||
/// Force HTTP/1.1 upstream
|
||||
ForceHttp11Upstream,
|
||||
/// Force HTTP/2 upstream
|
||||
ForceHttp2Upstream,
|
||||
// TODO: Adds more options for heder override
|
||||
}
|
||||
|
|
@ -13,6 +20,7 @@ impl TryFrom<&str> for UpstreamOption {
|
|||
fn try_from(val: &str) -> RpxyResult<Self> {
|
||||
match val {
|
||||
"keep_original_host" => Ok(Self::KeepOriginalHost),
|
||||
"set_upstream_host" => Ok(Self::SetUpstreamHost),
|
||||
"upgrade_insecure_requests" => Ok(Self::UpgradeInsecureRequests),
|
||||
"force_http11_upstream" => Ok(Self::ForceHttp11Upstream),
|
||||
"force_http2_upstream" => Ok(Self::ForceHttp2Upstream),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue