mirror of
https://github.com/openai/codex.git
synced 2026-05-04 19:36:45 +00:00
address feedback
This commit is contained in:
@@ -21,10 +21,10 @@ pub fn is_loopback_host(host: &str) -> bool {
|
||||
|
||||
pub fn normalize_host(host: &str) -> String {
|
||||
let host = host.trim();
|
||||
if host.starts_with('[') {
|
||||
if let Some(end) = host.find(']') {
|
||||
return host[1..end].to_ascii_lowercase();
|
||||
}
|
||||
if host.starts_with('[')
|
||||
&& let Some(end) = host.find(']')
|
||||
{
|
||||
return host[1..end].to_ascii_lowercase();
|
||||
}
|
||||
host.split(':').next().unwrap_or("").to_ascii_lowercase()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user