From abcb3856f9bef7c00d7578b9febdc1b8d51d2632 Mon Sep 17 00:00:00 2001 From: smallchill Date: Thu, 27 Dec 2018 23:12:41 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/boot/feign/BladeFeignRequestHeaderInterceptor.java | 3 ++- .../java/org/springblade/core/secure/utils/SecureUtil.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blade-core-boot/src/main/java/org/springblade/core/boot/feign/BladeFeignRequestHeaderInterceptor.java b/blade-core-boot/src/main/java/org/springblade/core/boot/feign/BladeFeignRequestHeaderInterceptor.java index bb3d9e8..d47469e 100644 --- a/blade-core-boot/src/main/java/org/springblade/core/boot/feign/BladeFeignRequestHeaderInterceptor.java +++ b/blade-core-boot/src/main/java/org/springblade/core/boot/feign/BladeFeignRequestHeaderInterceptor.java @@ -18,6 +18,7 @@ package org.springblade.core.boot.feign; import feign.RequestInterceptor; import feign.RequestTemplate; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.secure.utils.SecureUtil; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -42,7 +43,7 @@ public class BladeFeignRequestHeaderInterceptor implements RequestInterceptor { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); String value = request.getHeader(name); - if ("Authorization".equals(name)) { + if (SecureUtil.HEADER.equals(name)) { requestTemplate.header(name, value); } } diff --git a/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java b/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java index 9d4880b..66e22f3 100644 --- a/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java +++ b/blade-core-secure/src/main/java/org/springblade/core/secure/utils/SecureUtil.java @@ -40,7 +40,7 @@ import java.util.Map; public class SecureUtil { public static final String BLADE_USER_REQUEST_ATTR = "_BLADE_USER_REQUEST_ATTR_"; - public final static String HEADER = "Authorization"; + public final static String HEADER = "blade-auth"; public final static String BEARER = "bearer"; public final static String ACCOUNT = "account"; public final static String USER_ID = "userId";