Skip to content

Commit c930bf5

Browse files
authored
normalize paths and remove trailing slash (#285)
1 parent 2442ed6 commit c930bf5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*.orig
55
*.patch
66
*.rej
7+
.gocache

pkg/util/jsonrpc.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ func (client *RPCClient) CallSBCLI(method, path string, args interface{}) (inter
439439
data := []byte(`{}`)
440440
var err error
441441

442+
// Normalize the path to avoid double slashes when building URLs
443+
path = strings.TrimLeft(path, "/")
444+
442445
if args != nil {
443446
data, err = json.Marshal(args)
444447
if err != nil {

0 commit comments

Comments
 (0)