Skip to content

Commit

Permalink
Get the PeerID from the target URL, not from the request
Browse files Browse the repository at this point in the history
  • Loading branch information
mcamou committed Nov 26, 2024
1 parent e003173 commit c65ec1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/network/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (p *Proxy) handleTunnel(ctx context.Context, w http.ResponseWriter, req *ht
return
}

Check warning on line 74 in pkg/network/proxy.go

View check run for this annotation

Codecov / codecov/patch

pkg/network/proxy.go#L69-L74

Added lines #L69 - L74 were not covered by tests

parts := strings.Split(req.Host, ":")
parts := strings.Split(req.URL.Host, ":")
peerId, err := peer.IDFromBytes([]byte(parts[0]))
if err != nil {
http.Error(w, fmt.Sprintf("Invalid peerID '%s'", parts[0]), http.StatusBadRequest)
Expand Down

0 comments on commit c65ec1a

Please sign in to comment.