Skip to content

Commit

Permalink
fix(mock): correct query param mocks (#866)
Browse files Browse the repository at this point in the history
Co-authored-by: David May <[email protected]>
  • Loading branch information
ecrupper and wass3rw3rk authored Jun 8, 2023
1 parent e8bdb15 commit 63d323f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mock/server/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,18 +342,18 @@ func buildToken(c *gin.Context) {

// cleanResources has a query param :before returns mock JSON for a http PUT
//
// Pass "0" to :before to test receiving a http 500 response. Pass "1" to :before
// Pass "1" to :before to test receiving a http 500 response. Pass "2" to :before
// to test receiving a http 401 response.
func cleanResoures(c *gin.Context) {
before := c.Query("before")

if strings.EqualFold(before, "0") {
if strings.EqualFold(before, "1") {
c.AbortWithStatusJSON(http.StatusInternalServerError, "")

return
}

if strings.EqualFold(before, "1") {
if strings.EqualFold(before, "2") {
c.AbortWithStatusJSON(http.StatusUnauthorized, "")
}

Expand Down

0 comments on commit 63d323f

Please sign in to comment.