Skip to content

Commit

Permalink
fix: remove exist check from MustGet
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Mar 28, 2023
1 parent 6bc4167 commit 765bb23
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions router/middleware/perm/perm.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,7 @@ func MustServer() gin.HandlerFunc {
}

// retrieve the configured server address from the context
addr, ok := c.MustGet("server-address").(string)
if !ok {
msg := "error retrieving server address"

logrus.Error(msg)

c.AbortWithStatusJSON(http.StatusInternalServerError, types.Error{Message: &msg})

return
}
addr := c.MustGet("server-address").(string)

// create a temporary client to validate the incoming request
vela, err := vela.NewClient(addr, "vela-worker", nil)
Expand Down

0 comments on commit 765bb23

Please sign in to comment.