Fixes regression from #848

The api for actix_web::dev::ConnectionInfo changed from 2.0.0 to 3.0.0. The equivalent of 2.0.0's remote() in 3.0.0 is realip_remote_addr(), not remote_addr().

https://docs.rs/actix-web/2.0.0/actix_web/dev/struct.ConnectionInfo.html#method.remote
https://docs.rs/actix-web/3.0.0-alpha.3/actix_web/dev/struct.ConnectionInfo.html#method.realip_remote_addr
This commit is contained in:
Pierce 2020-07-08 02:20:08 -04:00 committed by GitHub
parent 8fda7d00d5
commit 2f01e15cae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -325,7 +325,7 @@ pub fn markdown_to_html(text: &str) -> String {
pub fn get_ip(conn_info: &ConnectionInfo) -> String { pub fn get_ip(conn_info: &ConnectionInfo) -> String {
conn_info conn_info
.remote_addr() .realip_remote_addr()
.unwrap_or("127.0.0.1:12345") .unwrap_or("127.0.0.1:12345")
.split(':') .split(':')
.next() .next()