mirror of
https://github.com/sadoyan/aralez.git
synced 2026-07-01 03:42:21 +08:00
Header parsing broken with rsplit_once in populate_headers_and_auth and build_headers
closed #48
This commit is contained in:
@@ -157,7 +157,7 @@ async fn populate_headers_and_auth(config: &mut Configuration, parsed: &Config)
|
||||
let mut ch: Vec<(String, Arc<str>)> = Vec::new();
|
||||
if let Some(headers) = &parsed.client_headers {
|
||||
for header in headers {
|
||||
if let Some((key, val)) = header.rsplit_once(':') {
|
||||
if let Some((key, val)) = header.split_once(':') {
|
||||
ch.push((key.to_string(), Arc::from(val)));
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ async fn populate_headers_and_auth(config: &mut Configuration, parsed: &Config)
|
||||
let mut sh: Vec<(String, Arc<str>)> = Vec::new();
|
||||
if let Some(headers) = &parsed.server_headers {
|
||||
for header in headers {
|
||||
if let Some((key, val)) = header.rsplit_once(':') {
|
||||
if let Some((key, val)) = header.split_once(':') {
|
||||
sh.push((key.to_string(), Arc::from(val.trim())));
|
||||
}
|
||||
}
|
||||
@@ -321,7 +321,7 @@ fn parce_tls_grades(what: Option<String>) -> Option<String> {
|
||||
pub fn build_headers(path_config: &Option<Vec<String>>, _config: &Configuration, hl: &mut Vec<(String, Arc<str>)>) {
|
||||
if let Some(headers) = &path_config {
|
||||
for header in headers {
|
||||
if let Some((key, val)) = header.rsplit_once(':') {
|
||||
if let Some((key, val)) = header.split_once(':') {
|
||||
hl.push((key.trim().to_string(), Arc::from(val.trim())));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user