Default ?wait= to 0 seconds (#190)

This commit is contained in:
Nikolay Edigaryev 2024-07-03 23:07:14 +04:00 committed by GitHub
parent 76f192bdb0
commit 4df43e6432
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ func (controller *Controller) ip(ctx *gin.Context) responder.Responder {
// Retrieve and parse path and query parameters
name := ctx.Param("name")
waitRaw := ctx.Query("wait")
waitRaw := ctx.DefaultQuery("wait", "0")
wait, err := strconv.ParseUint(waitRaw, 10, 16)
if err != nil {
return responder.Code(http.StatusBadRequest)

View File

@ -33,7 +33,7 @@ func (controller *Controller) portForwardVM(ctx *gin.Context) responder.Responde
return responder.Code(http.StatusBadRequest)
}
waitRaw := ctx.Query("wait")
waitRaw := ctx.DefaultQuery("wait", "0")
wait, err := strconv.ParseUint(waitRaw, 10, 16)
if err != nil {
return responder.Code(http.StatusBadRequest)