Use sprintf

This commit is contained in:
Zoltán Papp 2024-11-06 14:38:13 +01:00
parent d31ca9c537
commit 3635c0f93f

View File

@ -96,5 +96,5 @@ func remoteAddr(r *http.Request) string {
if r.Header.Get("X-Real-Ip") == "" || r.Header.Get("X-Real-Port") == "" {
return r.RemoteAddr
}
return r.Header.Get("X-Real-Ip") + ":" + r.Header.Get("X-Real-Port")
return fmt.Sprintf("%s:%s", r.Header.Get("X-Real-Ip"), r.Header.Get("X-Real-Port"))
}