Skip to content

Commit

Permalink
Respond to request regardless of origin
Browse files Browse the repository at this point in the history
  • Loading branch information
jdowning100 committed Dec 2, 2024
1 parent 3736c48 commit 902ddef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion node/rpcstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ func (h *virtualHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
host, _, err := net.SplitHostPort(r.Host)
if err != nil {
// Either invalid (too many colons) or no port specified
log.Global.Errorf("Invalid Host header %s: %v", r.Host, err)
host = r.Host
}
if ipAddr := net.ParseIP(host); ipAddr != nil {
Expand All @@ -442,7 +443,8 @@ func (h *virtualHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.next.ServeHTTP(w, r)
return
}
http.Error(w, "invalid host specified", http.StatusForbidden)
h.next.ServeHTTP(w, r)
return
}

var gzPool = sync.Pool{
Expand Down

0 comments on commit 902ddef

Please sign in to comment.