mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-05 15:46:58 +08:00
api: return 404 when a path configuration is not found (#2067) (#2074)
Some checks reported warnings
lint / code (push) Has been cancelled
lint / mod-tidy (push) Has been cancelled
lint / apidocs (push) Has been cancelled
test / test64 (push) Has been cancelled
test / test32 (push) Has been cancelled
test / test_highlevel (push) Has been cancelled
Some checks reported warnings
lint / code (push) Has been cancelled
lint / mod-tidy (push) Has been cancelled
lint / apidocs (push) Has been cancelled
test / test64 (push) Has been cancelled
test / test32 (push) Has been cancelled
test / test_highlevel (push) Has been cancelled
this involves /v2/config/paths/edit and /v2/config/paths/remove
This commit is contained in:
@@ -605,6 +605,8 @@ paths:
|
|||||||
description: the request was successful.
|
description: the request was successful.
|
||||||
'400':
|
'400':
|
||||||
description: invalid request.
|
description: invalid request.
|
||||||
|
'404':
|
||||||
|
description: configuration not found.
|
||||||
'500':
|
'500':
|
||||||
description: internal server error.
|
description: internal server error.
|
||||||
|
|
||||||
@@ -625,6 +627,8 @@ paths:
|
|||||||
description: the request was successful.
|
description: the request was successful.
|
||||||
'400':
|
'400':
|
||||||
description: invalid request.
|
description: invalid request.
|
||||||
|
'404':
|
||||||
|
description: configuration not found.
|
||||||
'500':
|
'500':
|
||||||
description: internal server error.
|
description: internal server error.
|
||||||
|
|
||||||
|
@@ -409,7 +409,7 @@ func (a *api) onConfigPathsEdit(ctx *gin.Context) {
|
|||||||
|
|
||||||
newConfPath, ok := newConf.Paths[name]
|
newConfPath, ok := newConf.Paths[name]
|
||||||
if !ok {
|
if !ok {
|
||||||
ctx.AbortWithStatus(http.StatusBadRequest)
|
ctx.AbortWithStatus(http.StatusNotFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user