[control] The admin host is accepted with any port (Docker or a router may publish 443 elsewhere); smoke scripts: Windows-readable paths, curl without Schannel's revocation check, logs on failure
This commit is contained in:
@@ -357,11 +357,16 @@ pub(crate) fn host_allowed(ctl: &Control, headers: &HeaderMap) -> bool {
|
||||
format!("127.0.0.1:{port}"),
|
||||
format!("[::1]:{port}"),
|
||||
];
|
||||
// The admin host edge forwards the UI on, with or without edge's HTTPS port.
|
||||
// The admin host the engine forwards the UI on, with any port: behind Docker's or a
|
||||
// router's port mapping the visitor's port is not the engine's (T4). The name is what
|
||||
// keeps a rebound DNS name out.
|
||||
let ui = ctl.cfg.ui.as_ref().and_then(|u| u.hostname.as_deref());
|
||||
let ui_ok = ui.is_some_and(|u| {
|
||||
let edge_port = ctl.cfg.compile.https_listen.port();
|
||||
host.eq_ignore_ascii_case(u) || host.eq_ignore_ascii_case(&format!("{u}:{edge_port}"))
|
||||
let name = match host.rsplit_once(':') {
|
||||
Some((n, p)) if !p.is_empty() && p.bytes().all(|c| c.is_ascii_digit()) => n,
|
||||
_ => host,
|
||||
};
|
||||
name.eq_ignore_ascii_case(u)
|
||||
});
|
||||
ui_ok
|
||||
|| ok.iter().any(|o| o.eq_ignore_ascii_case(host))
|
||||
|
||||
Reference in New Issue
Block a user