Skip to content

Commit

Permalink
Fix bug in ip parsing in state.go
Browse files Browse the repository at this point in the history
  • Loading branch information
t94j0 committed Apr 26, 2021
1 parent 71153ee commit 611a60a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion satellite/path/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/binary"
"net"
"strings"

// Used for gosql
_ "github.com/mattn/go-sqlite3"
Expand Down Expand Up @@ -72,7 +73,8 @@ func (s *State) Hit(req *http.Request) error {
path := req.URL.Path

// ClientID Hit
remoteAddr := net.ParseIP(req.RemoteAddr)
ip := strings.Split(req.RemoteAddr, ":")[0]
remoteAddr := net.ParseIP(ip)
s.pathIdentifier.Hit(remoteAddr, path)

// DB Hit
Expand Down

0 comments on commit 611a60a

Please sign in to comment.