@Test public void removesConnectionHeadersFromResponse() throws Exception { LiveHttpResponse response = Mono.from(interceptor.intercept(get("/foo").build(), returnsResponse(response() .header(CONNECTION, "Foo, Bar, Baz") .header("Foo", "abc") .header("Foo", "def") .header("Bar", "one, two, three") .build()))).block(); assertThat(response.header(CONNECTION), isAbsent()); assertThat(response.header("Foo"), isAbsent()); assertThat(response.header("Bar"), isAbsent()); assertThat(response.header("Baz"), isAbsent()); }
@Override public Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain chain) { return chain.proceed(removeHopByHopHeaders(request)) .map(HopByHopHeadersRemovingInterceptor::removeHopByHopHeaders); }
HopByHopHeadersRemovingInterceptor implements HttpInterceptor { @Override public Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain chain) { return chain.proceed(removeHopByHopHeaders(request)) .map(HopByHopHeadersRemovingInterceptor::removeHopByHopHeaders); } }
HopByHopHeadersRemovingInterceptor implements HttpInterceptor { @Override public Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain chain) { return chain.proceed(removeHopByHopHeaders(request)) .map(HopByHopHeadersRemovingInterceptor::removeHopByHopHeaders); }  }
HopByHopHeadersRemovingInterceptor implements HttpInterceptor { @Override public Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain chain) { return chain.proceed(removeHopByHopHeaders(request)) .map(HopByHopHeadersRemovingInterceptor::removeHopByHopHeaders); }  @Override Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain chain); }
HopByHopHeadersRemovingInterceptor implements HttpInterceptor { @Override public Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain chain) { return chain.proceed(removeHopByHopHeaders(request)) .map(HopByHopHeadersRemovingInterceptor::removeHopByHopHeaders); }  @Override Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain chain);  }