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

liuhongyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new ff204b8ebf fix: correct logic in local key validation in 
LocalDispatcherFilter (#6086)
ff204b8ebf is described below

commit ff204b8ebf6c849b5c43aac01d5e95a0ea9224e6
Author: Jast <[email protected]>
AuthorDate: Tue Aug 5 20:57:32 2025 +0800

    fix: correct logic in local key validation in LocalDispatcherFilter (#6086)
    
    Co-authored-by: aias00 <[email protected]>
---
 .../main/java/org/apache/shenyu/web/filter/LocalDispatcherFilter.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/shenyu-web/src/main/java/org/apache/shenyu/web/filter/LocalDispatcherFilter.java
 
b/shenyu-web/src/main/java/org/apache/shenyu/web/filter/LocalDispatcherFilter.java
index 5afef0cab6..93ef53beb1 100644
--- 
a/shenyu-web/src/main/java/org/apache/shenyu/web/filter/LocalDispatcherFilter.java
+++ 
b/shenyu-web/src/main/java/org/apache/shenyu/web/filter/LocalDispatcherFilter.java
@@ -58,7 +58,7 @@ public class LocalDispatcherFilter extends AbstractWebFilter {
     @Override
     protected Mono<Void> doFilter(final ServerWebExchange exchange) {
         String localKey = 
exchange.getRequest().getHeaders().getFirst(Constants.LOCAL_KEY);
-        if (Objects.isNull(sha512Key) || 
!sha512Key.equalsIgnoreCase(DigestUtils.sha512Hex(localKey)) || 
Objects.isNull(localKey)) {
+        if (Objects.isNull(sha512Key) || Objects.isNull(localKey) || 
!sha512Key.equalsIgnoreCase(DigestUtils.sha512Hex(localKey))) {
             return Mono.error(new 
ResponseStatusException(HttpStatus.FORBIDDEN, "The key is not correct."));
         }
         return dispatcherHandler.handle(exchange);

Reply via email to