use of com.hotels.styx.common.format.SanitisedHttpHeaderFormatter in project styx by ExpediaGroup.
the class StyxServerComponents method newEnvironment.
private static Environment newEnvironment(StyxConfig config, MeterRegistry registry) {
SanitisedHttpHeaderFormatter headerFormatter = new SanitisedHttpHeaderFormatter(config.get("request-logging.hideHeaders", List.class).orElse(emptyList()), config.get("request-logging.hideCookies", List.class).orElse(emptyList()));
SanitisedHttpMessageFormatter sanitisedHttpMessageFormatter = new SanitisedHttpMessageFormatter(headerFormatter);
return new Environment.Builder().configuration(config).registry(registry).buildInfo(readBuildInfo()).eventBus(new AsyncEventBus("styx", newSingleThreadExecutor())).httpMessageFormatter(sanitisedHttpMessageFormatter).build();
}
use of com.hotels.styx.common.format.SanitisedHttpHeaderFormatter in project styx by ExpediaGroup.
the class NettyToStyxRequestDecoderTest method decode.
private LiveHttpRequest decode(HttpRequest request) {
HttpRequestRecorder requestRecorder = new HttpRequestRecorder();
HttpMessageFormatter formatter = new SanitisedHttpMessageFormatter(new SanitisedHttpHeaderFormatter(Arrays.asList("secret-header"), Arrays.asList("secret-cookie")));
EmbeddedChannel channel = new EmbeddedChannel(new NettyToStyxRequestDecoder.Builder().uniqueIdSupplier(uniqueIdSupplier).httpMessageFormatter(formatter).build(), requestRecorder);
channel.writeInbound(request);
return requestRecorder.styxRequest;
}
Aggregations