Performance optimization in headers

This commit is contained in:
Ara Sadoyan
2026-01-28 16:07:45 +01:00
parent 6ef7f23823
commit 1a4c9b7d55
3 changed files with 67 additions and 46 deletions

View File

@@ -67,7 +67,6 @@ pub async fn load_configuration(d: &str, kind: &str) -> (Option<Configuration>,
async fn populate_headers_and_auth(config: &mut Configuration, parsed: &Config) {
let mut ch: Vec<(Arc<str>, Arc<str>)> = Vec::new();
ch.push((Arc::from("Server"), Arc::from("Aralez")));
if let Some(headers) = &parsed.client_headers {
for header in headers {
if let Some((key, val)) = header.split_once(':') {
@@ -80,7 +79,6 @@ async fn populate_headers_and_auth(config: &mut Configuration, parsed: &Config)
config.client_headers.insert(Arc::from("GLOBAL_CLIENT_HEADERS"), global_headers);
let mut sh: Vec<(Arc<str>, Arc<str>)> = Vec::new();
sh.push((Arc::from("X-Proxy-Server"), Arc::from("Aralez")));
if let Some(headers) = &parsed.server_headers {
for header in headers {
if let Some((key, val)) = header.split_once(':') {