Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
alcounit committed Feb 15, 2023
1 parent 425e1f6 commit 2ff7269
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ type req struct {
*http.Request
}

func (r req) buildURL(hostPort, sessionID string) *sess {
host, port, _ := net.SplitHostPort(hostPort)
func (r req) buildURL(sessionID string) *sess {
hostPort := r.Context().Value(http.LocalAddrContextKey).(net.Addr).String()
_, port, _ := net.SplitHostPort(hostPort)

return &sess{
url: fmt.Sprintf("http://%s/wd/hub/session/%s", net.JoinHostPort(host, port), sessionID),
url: fmt.Sprintf("http://%s/wd/hub/session/%s", net.JoinHostPort("127.0.0.1", port), sessionID),
id: sessionID,
}
}
Expand Down

0 comments on commit 2ff7269

Please sign in to comment.