http to https redirect cleanup

This commit is contained in:
Ara Sadoyan
2025-05-26 12:42:01 +02:00
parent d38588a299
commit 2a93bc2cd6
6 changed files with 35 additions and 38 deletions

View File

@@ -13,7 +13,8 @@ pub fn load_configuration(d: &str, kind: &str) -> Option<Configuration> {
consul: None,
typecfg: "".to_string(),
extraparams: Extraparams {
stickysessions: false,
sticky_sessions: false,
to_ssl: None,
authentication: DashMap::new(),
},
};
@@ -56,7 +57,10 @@ pub fn load_configuration(d: &str, kind: &str) -> Option<Configuration> {
}
global_headers.insert("/".to_string(), hl);
toreturn.headers.insert("GLOBAL_HEADERS".to_string(), global_headers);
toreturn.extraparams.stickysessions = parsed.stickysessions;
toreturn.extraparams.sticky_sessions = parsed.sticky_sessions;
toreturn.extraparams.to_ssl = parsed.to_ssl;
let cfg = DashMap::new();
if let Some(k) = globals.get("authorization") {
cfg.insert("authorization".to_string(), k.to_owned());

View File

@@ -16,7 +16,8 @@ pub struct ServiceMapping {
#[derive(Clone, Debug)]
pub struct Extraparams {
pub stickysessions: bool,
pub sticky_sessions: bool,
pub to_ssl: Option<bool>,
pub authentication: DashMap<String, Vec<String>>,
}
@@ -29,7 +30,8 @@ pub struct Consul {
#[derive(Debug, Serialize, Deserialize)]
pub struct Config {
pub provider: String,
pub stickysessions: bool,
pub sticky_sessions: bool,
pub to_ssl: Option<bool>,
pub upstreams: Option<HashMap<String, HostConfig>>,
pub globals: Option<HashMap<String, Vec<String>>>,
pub consul: Option<Consul>,