Browse Source

api: return 404 when a path configuration is not found (#2067) (#2074)

this involves /v2/config/paths/edit and /v2/config/paths/remove
pull/2080/head
Alessandro Ros 2 years ago committed by GitHub
parent
commit
f7a30e7b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apidocs/openapi.yaml
  2. 2
      internal/core/api.go

4
apidocs/openapi.yaml

@ -605,6 +605,8 @@ paths: @@ -605,6 +605,8 @@ paths:
description: the request was successful.
'400':
description: invalid request.
'404':
description: configuration not found.
'500':
description: internal server error.
@ -625,6 +627,8 @@ paths: @@ -625,6 +627,8 @@ paths:
description: the request was successful.
'400':
description: invalid request.
'404':
description: configuration not found.
'500':
description: internal server error.

2
internal/core/api.go

@ -409,7 +409,7 @@ func (a *api) onConfigPathsEdit(ctx *gin.Context) { @@ -409,7 +409,7 @@ func (a *api) onConfigPathsEdit(ctx *gin.Context) {
newConfPath, ok := newConf.Paths[name]
if !ok {
ctx.AbortWithStatus(http.StatusBadRequest)
ctx.AbortWithStatus(http.StatusNotFound)
return
}

Loading…
Cancel
Save