Skip to content

Commit 1c3e069

Browse files
Merge pull request #587 from cloudnautique/main
fix: join the server and url with url joinpath.
2 parents 9175120 + 337febb commit 1c3e069

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/engine/openapi.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ func (e *Engine) runOpenAPI(tool types.Tool, input string) (*Return, error) {
112112
instructions.Path = handlePathParameters(instructions.Path, instructions.PathParameters, input)
113113

114114
// Parse the URL
115-
u, err := url.Parse(instructions.Server + instructions.Path)
115+
path, err := url.JoinPath(instructions.Server, instructions.Path)
116+
if err != nil {
117+
return nil, fmt.Errorf("failed to join server and path: %w", err)
118+
}
119+
120+
u, err := url.Parse(path)
116121
if err != nil {
117122
return nil, fmt.Errorf("failed to parse server URL %s: %w", instructions.Server+instructions.Path, err)
118123
}

0 commit comments

Comments
 (0)