add request header override option

This commit is contained in:
Jun Kurihara 2022-07-06 17:40:45 +09:00
commit b0a9b6b5f8
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
10 changed files with 104 additions and 18 deletions

View file

@ -40,15 +40,16 @@ pub struct TlsOption {
#[derive(Deserialize, Debug, Default)]
pub struct ReverseProxyOption {
pub path: Option<String>,
pub upstream: Vec<UpstreamOption>,
pub upstream: Vec<UpstreamParams>,
pub upstream_options: Option<Vec<String>>,
}
#[derive(Deserialize, Debug, Default)]
pub struct UpstreamOption {
pub struct UpstreamParams {
pub location: String,
pub tls: Option<bool>,
}
impl UpstreamOption {
impl UpstreamParams {
pub fn to_uri(&self) -> Result<hyper::Uri> {
let mut scheme = "http";
if let Some(t) = self.tls {