mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-22 09:09:07 -05:00
refactor: rename get_header_remote_ip -> get_header_string
This function has nothing to do with remote ips!
This commit is contained in:
parent
ae5bf98d87
commit
a6cb6f8486
|
@ -91,7 +91,7 @@ async fn handle_web_request(
|
||||||
.network
|
.network
|
||||||
.remote_ip_header
|
.remote_ip_header
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|x| get_header_remote_ip(x, request.headers()));
|
.and_then(|x| get_header_string(x, request.headers()));
|
||||||
// use the socket addr as a backup
|
// use the socket addr as a backup
|
||||||
let remote_ip =
|
let remote_ip =
|
||||||
header_ip.unwrap_or_else(|| remote_addr.ip().to_string());
|
header_ip.unwrap_or_else(|| remote_addr.ip().to_string());
|
||||||
|
@ -161,7 +161,7 @@ async fn handle_web_request(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_header_remote_ip(header: &str, headers: &HeaderMap) -> Option<String> {
|
fn get_header_string(header: &str, headers: &HeaderMap) -> Option<String> {
|
||||||
headers
|
headers
|
||||||
.get(header)
|
.get(header)
|
||||||
.and_then(|x| x.to_str().ok().map(|x| x.to_string()))
|
.and_then(|x| x.to_str().ok().map(|x| x.to_string()))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user