use of io.servicetalk.http.api.ContentCodingHttpServiceFilter in project servicetalk by apple.
the class ServiceTalkContentCodingTest method newServiceTalkServer.
private ServerContext newServiceTalkServer(final Scenario scenario, final Queue<Throwable> errors) throws Exception {
HttpServerBuilder httpServerBuilder = HttpServers.forAddress(localAddress(0));
StreamingHttpService service = (ctx, request, responseFactory) -> succeeded(buildResponse(responseFactory));
StreamingHttpServiceFilterFactory filterFactory = REQ_FILTER.apply(scenario, errors);
return httpServerBuilder.executionStrategy(defaultStrategy()).protocols(scenario.protocol.config).appendServiceFilter(new ContentCodingHttpServiceFilter(scenario.serverSupported, scenario.serverSupported)).appendServiceFilter(filterFactory).listenStreamingAndAwait(service);
}
Aggregations