标签:tor app component void inter Servle ext values feign
@Component public class SecuringRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate requestTemplate) { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder .getRequestAttributes(); HttpServletRequest request = attributes.getRequest(); Enumeration<String> headerNames = request.getHeaderNames(); if (headerNames != null) { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); String values = request.getHeader(name); requestTemplate.header(name, values); } } } }
RequestInterceptor 是feign包中的
标签:tor app component void inter Servle ext values feign
原文地址:https://www.cnblogs.com/hanzhengjie/p/14536900.html