Skip to content

Commit

Permalink
fix: change AddAPIKey type from read to write
Browse files Browse the repository at this point in the history
This commit ensures that we avoid targeting DSNs when adding API keys.
  • Loading branch information
rayrutjes authored and aseure committed Dec 7, 2018
1 parent ebe51f5 commit 8465764
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion algoliasearch/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (c *client) AddAPIKeyWithRequestOptions(ACL []string, params Map, opts *Req
return
}

err = c.request(&res, "POST", "/1/keys/", req, read, opts)
err = c.request(&res, "POST", "/1/keys/", req, write, opts)
return
}

Expand Down
2 changes: 1 addition & 1 deletion algoliasearch/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (i *index) AddAPIKeyWithRequestOptions(ACL []string, params Map, opts *Requ
}

path := i.route + "/keys"
err = i.client.request(&res, "POST", path, req, read, opts)
err = i.client.request(&res, "POST", path, req, write, opts)
return
}

Expand Down

0 comments on commit 8465764

Please sign in to comment.