Search in sources :

Example 1 with HttpMessageFormatter

use of com.hotels.styx.common.format.HttpMessageFormatter 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;
}
Also used : HttpMessageFormatter(com.hotels.styx.common.format.HttpMessageFormatter) SanitisedHttpMessageFormatter(com.hotels.styx.common.format.SanitisedHttpMessageFormatter) SanitisedHttpHeaderFormatter(com.hotels.styx.common.format.SanitisedHttpHeaderFormatter) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) SanitisedHttpMessageFormatter(com.hotels.styx.common.format.SanitisedHttpMessageFormatter)

Aggregations

HttpMessageFormatter (com.hotels.styx.common.format.HttpMessageFormatter)1 SanitisedHttpHeaderFormatter (com.hotels.styx.common.format.SanitisedHttpHeaderFormatter)1 SanitisedHttpMessageFormatter (com.hotels.styx.common.format.SanitisedHttpMessageFormatter)1 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)1