use of com.hotels.styx.proxy.interceptors.RequestEnrichingInterceptor in project styx by ExpediaGroup.
the class BuiltInInterceptors method internalStyxInterceptors.
static List<HttpInterceptor> internalStyxInterceptors(StyxConfig config, HttpMessageFormatter httpMessageFormatter) {
List<HttpInterceptor> builder = new ArrayList<>();
boolean loggingEnabled = config.get("request-logging.inbound.enabled", Boolean.class).orElse(false);
boolean longFormatEnabled = config.get("request-logging.inbound.longFormat", Boolean.class).orElse(false);
if (loggingEnabled) {
builder.add(new HttpMessageLoggingInterceptor(longFormatEnabled, httpMessageFormatter));
}
builder.addAll(asList(new TcpTunnelRequestRejector(), new ConfigurationContextResolverInterceptor(EMPTY_CONFIGURATION_CONTEXT_RESOLVER), new UnexpectedRequestContentLengthRemover(), config.proxyServerConfig().via().map(ViaHeaderAppendingInterceptor::new).orElseGet(ViaHeaderAppendingInterceptor::new), new HopByHopHeadersRemovingInterceptor(), new RequestEnrichingInterceptor(config.styxHeaderConfig())));
return List.copyOf(builder);
}
Aggregations