chore: tweak linter warning

This commit is contained in:
Steven 2024-08-24 00:22:38 +08:00
parent 93bb880e8e
commit 4098ac824e

View File

@ -149,14 +149,14 @@ func (s *FrontendService) createShortcutViewActivity(ctx context.Context, reques
}
func getReadUserIP(r *http.Request) string {
IPAddress := r.Header.Get("X-Real-Ip")
if IPAddress == "" {
IPAddress = r.Header.Get("X-Forwarded-For")
ip := r.Header.Get("X-Real-Ip")
if ip == "" {
ip = r.Header.Get("X-Forwarded-For")
}
if IPAddress == "" {
IPAddress = r.RemoteAddr
if ip == "" {
ip = r.RemoteAddr
}
return IPAddress
return ip
}
func getFileSystem(path string) http.FileSystem {