d1a0d01a5e
Signed-off-by: Odyssey346 <odyssey346@disroot.org>
16 lines
276 B
Go
16 lines
276 B
Go
package otherthings
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// Thanks random StackOverflow answerer
|
|
|
|
func GetUserIP(r *http.Request) string {
|
|
IPAddress := r.Header.Get("X-REAL-IP")
|
|
if IPAddress == "" {
|
|
IPAddress = r.Header.Get("X-FORWARDED-FOR")
|
|
}
|
|
return IPAddress
|
|
}
|