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 { func getReadUserIP(r *http.Request) string {
IPAddress := r.Header.Get("X-Real-Ip") ip := r.Header.Get("X-Real-Ip")
if IPAddress == "" { if ip == "" {
IPAddress = r.Header.Get("X-Forwarded-For") ip = r.Header.Get("X-Forwarded-For")
} }
if IPAddress == "" { if ip == "" {
IPAddress = r.RemoteAddr ip = r.RemoteAddr
} }
return IPAddress return ip
} }
func getFileSystem(path string) http.FileSystem { func getFileSystem(path string) http.FileSystem {