API: Refactor "404 Not Found" response handler #3931

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-01-16 20:56:43 +01:00
parent abfea6354c
commit 3946e2a16f
9 changed files with 34 additions and 30 deletions

View File

@@ -30,7 +30,7 @@ func CreateOAuthToken(router *gin.RouterGroup) {
// Prevent CDNs from caching this endpoint.
if header.IsCdn(c.Request) {
c.AbortWithStatus(http.StatusNotFound)
AbortNotFound(c)
return
}
@@ -139,7 +139,7 @@ func RevokeOAuthToken(router *gin.RouterGroup) {
// Prevent CDNs from caching this endpoint.
if header.IsCdn(c.Request) {
c.AbortWithStatus(http.StatusNotFound)
AbortNotFound(c)
return
}