mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-13 21:32:18 +00:00
new IP address scheme
This commit is contained in:
1 parent
306f78b762
commit
0ce7baaa0b
1 file changed
+9
-2
@@ -59,9 +59,16 @@ pub async fn legacy_get_speak(request: HttpRequest,
|
||||
|
||||
// NB: There is also `request.connection_info().remote()`, which contains
|
||||
// proxy info via X-Forwarded-For, etc.
|
||||
let ip_address = request.peer_addr()
|
||||
/*let ip_address = request.peer_addr()
|
||||
.map(|socket| socket.to_string())
|
||||
.unwrap_or("".to_string());
|
||||
.unwrap_or("".to_string());*/
|
||||
|
||||
// NB: Actually, we want the X-Forwarded-For IP address, since otherwise
|
||||
// we get the load balancer.
|
||||
let ip_address = request.connection_info()
|
||||
.remote()
|
||||
.unwrap_or("")
|
||||
.to_string();
|
||||
|
||||
let sentence_record = NewSentence {
|
||||
sentence: text.clone(),
|
||||
|
||||
Reference in new issue
Block a user