diff --git a/consensus/bor/heimdall/client.go b/consensus/bor/heimdall/client.go index d69f5ead3c..5c65721574 100644 --- a/consensus/bor/heimdall/client.go +++ b/consensus/bor/heimdall/client.go @@ -8,6 +8,7 @@ import ( "io" "net/http" "net/url" + "path" "sort" "time" @@ -420,7 +421,7 @@ func makeURL(urlString, rawPath, rawQuery string) (*url.URL, error) { return nil, err } - u.Path = rawPath + u.Path = path.Join(u.Path, rawPath) u.RawQuery = rawQuery return u, err diff --git a/consensus/bor/heimdall/client_test.go b/consensus/bor/heimdall/client_test.go index 5023b847a5..737875028c 100644 --- a/consensus/bor/heimdall/client_test.go +++ b/consensus/bor/heimdall/client_test.go @@ -399,7 +399,7 @@ func TestSpanURL(t *testing.T) { const expected = "http://bor0/bor/span/1" if url.String() != expected { - t.Fatalf("expected URL %q, got %q", url.String(), expected) + t.Fatalf("expected URL %q, got %q", expected, url.String()) } } @@ -414,6 +414,6 @@ func TestStateSyncURL(t *testing.T) { const expected = "http://bor0/clerk/event-record/list?from-id=10&to-time=100&limit=50" if url.String() != expected { - t.Fatalf("expected URL %q, got %q", url.String(), expected) + t.Fatalf("expected URL %q, got %q", expected, url.String()) } }