Skip to content

Commit

Permalink
add prefix / for non-prefixed path
Browse files Browse the repository at this point in the history
  • Loading branch information
Orkun Karaduman committed Dec 19, 2023
1 parent 61f860f commit d40f650
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions caller.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ func (f *Factory) Caller(endpoint string, method string, out interface{}, opts .
method: strings.ToUpper(method),
out: out,
}
if result.url.Path == "" {
result.url.Path = "/"
if !strings.HasPrefix(result.url.Path, "/") {
result.url.Path = "/" + result.url.Path
}
if endpoint != "" {
result.url.Path = path.Join(result.url.Path, endpoint)
Expand Down

0 comments on commit d40f650

Please sign in to comment.