feign属性输出

This commit is contained in:
zhangqinbin
2021-07-16 15:53:46 +08:00
parent 6b73b57435
commit e3225dfd1e

View File

@ -40,7 +40,9 @@ public class FeignConfig implements RequestInterceptor {
@Override
public void apply(RequestTemplate template) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
log.info("--------白名单-"+tokenWhiteList);
log.info("--------请求url-"+template.url());
if (Objects.nonNull(attributes)) {
if (isNonExistsWhiteList(template.url())) {
injectToken(template, attributes);
@ -76,6 +78,8 @@ public class FeignConfig implements RequestInterceptor {
*/
private void injectToken(RequestTemplate template, ServletRequestAttributes attributes) {
final String header = attributes.getRequest().getHeader(AUTHORIZATION_HEADER);// 提取request头信息
log.info("--------请求header信息-"+header);
// 移除已存的头信息
template.removeHeader(AUTHORIZATION_HEADER);