Accidentally referred to response headers, not request headers, when determining IP address
This commit is contained in:
parent
3d560ef770
commit
af9def38ba
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Version = "0.28.0"
|
var Version = "0.28.1"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(versionCmd)
|
rootCmd.AddCommand(versionCmd)
|
||||||
|
|
|
@ -294,8 +294,8 @@ func serveStaticFile(w http.ResponseWriter, r *http.Request, paths []string) err
|
||||||
|
|
||||||
if Verbose {
|
if Verbose {
|
||||||
remoteAddr := ""
|
remoteAddr := ""
|
||||||
cfIP := w.Header().Get("Cf-Connecting-Ip")
|
cfIP := r.Header.Get("Cf-Connecting-Ip")
|
||||||
xRealIp := w.Header().Get("X-Real-Ip")
|
xRealIp := r.Header.Get("X-Real-Ip")
|
||||||
if cfIP != "" {
|
if cfIP != "" {
|
||||||
remoteAddr = cfIP
|
remoteAddr = cfIP
|
||||||
} else if xRealIp != "" {
|
} else if xRealIp != "" {
|
||||||
|
|
Loading…
Reference in New Issue