Skip to content

Commit

Permalink
fix(privatelink): gcp create use empty json in request (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serpentiel authored Jul 18, 2023
1 parent a5373ed commit 3a32eb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gcp_privatelink.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ type (
func (h *GCPPrivatelinkHandler) Create(project, serviceName string) (*GCPPrivatelinkResponse, error) {
path := buildPath("project", project, "service", serviceName, "privatelink", "google")

bts, err := h.client.doPostRequest(path, nil)
// TODO: Remove struct{}{} when API is fixed, and use nil instead. See below for more details.
//
// Currently this endpoint requires a body, even though it's not used to process the request.
// We can't use nil because it's not a valid JSON, and the API returns a 400, so we use an empty struct.
// When the API is fixed, we can remove this workaround and use nil.
bts, err := h.client.doPostRequest(path, struct{}{})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3a32eb6

Please sign in to comment.