Skip to content

Commit d20d720

Browse files
committed
fix(create): escape id in query parameter
previously, ids in create did not escape their parameters, which would result in invalid HTTP requests.
1 parent 683eea6 commit d20d720

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/service/resource_definition.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"log/slog"
77
"net/http"
8+
"net/url"
89
"strings"
910

1011
"github.com/aep-dev/aep-lib-go/pkg/api"
@@ -63,7 +64,7 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
6364
p := withPrefix("")
6465
if r.Methods.Create.SupportsUserSettableCreate {
6566
id := args[0]
66-
p = withPrefix(fmt.Sprintf("?id=%s", id))
67+
p = withPrefix(fmt.Sprintf("?id=%s", url.QueryEscape(id)))
6768
}
6869
jsonBody, err := generateJsonPayload(cmd, createArgs)
6970
if err != nil {

0 commit comments

Comments
 (0)