You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ly...@apache.org on 2024/05/15 04:04:04 UTC

(incubator-devlake) branch dev-1 updated: fix(apikey): abort request if api key doesn't match

This is an automated email from the ASF dual-hosted git repository.

lynwee pushed a commit to branch dev-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/dev-1 by this push:
     new bd3804dec fix(apikey): abort request if api key doesn't match
bd3804dec is described below

commit bd3804dec379ae501d8ee42b081dc82c25d0d1d8
Author: d4x1 <15...@qq.com>
AuthorDate: Wed May 15 12:03:56 2024 +0800

    fix(apikey): abort request if api key doesn't match
---
 backend/server/api/middlewares.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/backend/server/api/middlewares.go b/backend/server/api/middlewares.go
index 32ec5e854..86c8c6a6f 100644
--- a/backend/server/api/middlewares.go
+++ b/backend/server/api/middlewares.go
@@ -121,6 +121,7 @@ func RestAuthentication(router *gin.Engine, basicRes context.BasicRes) gin.Handl
 		authHeader := c.GetHeader("Authorization")
 		ok := CheckAuthorizationHeader(c, logger, db, apiKeyHelper, authHeader, path)
 		if !ok {
+			c.Abort()
 			return
 		} else {
 			router.HandleContext(c)