[core] Schema: reject wildcard header names, cap file size and upstreams, require <hostname>.toml
This commit is contained in:
@@ -108,6 +108,21 @@ fn check_path(p: &str) -> Result<(), &'static str> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Identity headers never accepted from clients on forward-auth hosts: Authelia's four, then
|
||||
/// any other configured copy header (case-insensitive, no duplicates).
|
||||
fn strip_headers(fa: &crate::ForwardAuth) -> Vec<String> {
|
||||
let mut out: Vec<String> = crate::AUTHELIA_COPY_HEADERS
|
||||
.iter()
|
||||
.map(|h| (*h).to_owned())
|
||||
.collect();
|
||||
for h in &fa.copy_headers {
|
||||
if !out.iter().any(|o| o.eq_ignore_ascii_case(h)) {
|
||||
out.push(h.clone());
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Join a validated directory and a validated file name.
|
||||
fn join(dir: &str, file: &str) -> String {
|
||||
format!("{}/{}", dir.trim_end_matches('/'), file)
|
||||
|
||||
Reference in New Issue
Block a user