[#2372] use Fly-Client-IP header if available for the 'real' user ip
This commit is contained in:
		
							parent
							
								
									429929dd0c
								
							
						
					
					
						commit
						9fa56b020c
					
				| 
						 | 
					@ -368,6 +368,10 @@ func realUserIp(r *http.Request, fallbackIp string) string {
 | 
				
			||||||
		return ip
 | 
							return ip
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if ip := r.Header.Get("Fly-Client-IP"); ip != "" {
 | 
				
			||||||
 | 
							return ip
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ip := r.Header.Get("X-Real-IP"); ip != "" {
 | 
						if ip := r.Header.Get("X-Real-IP"); ip != "" {
 | 
				
			||||||
		return ip
 | 
							return ip
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue