small pixel drawing of a pufferfish j3s.sh

WHOA FJIEWJFIWEOJFIOWEJ
Jes Olson j3s@c3f.net
Fri, 18 Feb 2022 01:30:21 -0500
commit

dd1e6dcb88d34346749d29493259bec724bedd5b

parent

44c8f4257d617925cc075d98f7a445e9238d0930

1 files changed, 4 insertions(+), 14 deletions(-)

jump to
M main.gomain.go

@@ -10,7 +10,6 @@ "path/filepath"

"strings" "fmt" "bytes" - "net" "git.j3s.sh/j3s.sh/feed" "github.com/SlyMarbo/rss"

@@ -194,17 +193,8 @@ }

func ipHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain") - - // this header is always set by tlstunnel - ip, _, err := net.SplitHostPort(r.RemoteAddr) - if err != nil { - fmt.Fprintf(w, "bing bong, fuk ya life") - return - } - fmt.Fprintf(w, ip) - for name, values := range r.Header { - for _, value := range values { - fmt.Fprintf(w, "\n%v: %v\n", name, value) - } - } + // this header is always set by tlstunnel (MAYBE) + // so we can PROBABLY expect it to be here IDFK RLY + // ITS LATE AND IM TIRED + fmt.Fprintf(w, r.Header.Get("X-Forwarded-For")) }