initial announcements

Signed-off-by: Odyssey346 <odyssey346@disroot.org>
This commit is contained in:
Odyssey346
2022-08-03 21:37:12 +02:00
parent 2f6fbed9c0
commit c73b648451
9 changed files with 230 additions and 24 deletions

15
utils/getip.go Normal file
View File

@@ -0,0 +1,15 @@
package utils
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
}