Skip to content

Commit

Permalink
tweak: order of operations, move sanitize lower
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed May 30, 2024
1 parent ae353bf commit 36983c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/build/id_request_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func GetIDRequestToken(c *gin.Context) {
"user": cl.Subject,
}).Infof("generating ID request token for build %s/%d", b.GetRepo().GetFullName(), b.GetNumber())

image := util.Sanitize(c.Query("image"))
image := c.Query("image")
if len(image) == 0 {
retErr := errors.New("no step 'image' provided in query parameters")

Expand All @@ -104,7 +104,7 @@ func GetIDRequestToken(c *gin.Context) {
return
}

request := util.Sanitize(c.Query("request"))
request := c.Query("request")
if len(request) == 0 {
retErr := errors.New("no 'request' provided in query parameters")

Expand Down Expand Up @@ -133,8 +133,8 @@ func GetIDRequestToken(c *gin.Context) {
Repo: b.GetRepo().GetFullName(),
TokenType: constants.IDRequestTokenType,
TokenDuration: exp,
Image: image,
Request: request,
Image: util.Sanitize(image),
Request: util.Sanitize(request),
Commands: commands,
}

Expand Down

0 comments on commit 36983c6

Please sign in to comment.