You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/01/05 06:04:56 UTC

[GitHub] [apisix-dashboard] imjoey commented on a change in pull request #1206: fix: well handle with malformed auth token in request header

imjoey commented on a change in pull request #1206:
URL: https://github.com/apache/apisix-dashboard/pull/1206#discussion_r551733304



##########
File path: api/internal/filter/authentication.go
##########
@@ -41,8 +42,8 @@ func Authentication() gin.HandlerFunc {
 				"message": "Request Unauthorized",
 			}
 
-			if err != nil || !token.Valid {
-				log.Warnf("token validate failed: %s, %v", err, token.Valid)
+			if err != nil || token == nil || !token.Valid {
+				log.Warnf("token validate failed: %s, %v", err, false)

Review comment:
       @starsz  Thanks. It's to keep log format that same as before. How about change this to
   
   ```suggestion
   				log.Warnf("token validate failed: %s", err)
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org