Accidentally referred to response headers, not request headers, when determining IP address

This commit is contained in:
Seednode 2022-12-20 17:54:27 -06:00
parent 3d560ef770
commit af9def38ba
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra"
)
var Version = "0.28.0"
var Version = "0.28.1"
func init() {
rootCmd.AddCommand(versionCmd)

View File

@ -294,8 +294,8 @@ func serveStaticFile(w http.ResponseWriter, r *http.Request, paths []string) err
if Verbose {
remoteAddr := ""
cfIP := w.Header().Get("Cf-Connecting-Ip")
xRealIp := w.Header().Get("X-Real-Ip")
cfIP := r.Header.Get("Cf-Connecting-Ip")
xRealIp := r.Header.Get("X-Real-Ip")
if cfIP != "" {
remoteAddr = cfIP
} else if xRealIp != "" {