@Test public void protoHeaderHostHeaderWithPortAndPortHeaderCauseUriBuildersSchemeSetHostSetAndPortSet() { givenHeaders( "X-Forwarded-Proto", "https", "X-Forwarded-Host", "gravitee.io:4321", "X-Forwarded-Port", "1234" ); filter.filter(containerRequestContext); verifyUriBuildersChangedSchemeTo("https"); verifyUriBuildersChangedHostTo("gravitee.io"); verifyUriBuildersChangedPortTo(1234); }
@Override public void filter(ContainerRequestContext ctx) { UriBuilder baseBuilder = ctx.getUriInfo().getBaseUriBuilder(); UriBuilder requestBuilder = ctx.getUriInfo().getRequestUriBuilder(); processProtocolHeader(ctx, baseBuilder, requestBuilder); processHostHeader(ctx, baseBuilder, requestBuilder); processPortHeader(ctx, baseBuilder, requestBuilder); }
UriBuilderRequestFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext ctx) { UriBuilder baseBuilder = ctx.getUriInfo().getBaseUriBuilder(); UriBuilder requestBuilder = ctx.getUriInfo().getRequestUriBuilder(); processProtocolHeader(ctx, baseBuilder, requestBuilder); processHostHeader(ctx, baseBuilder, requestBuilder); processPortHeader(ctx, baseBuilder, requestBuilder); } }
UriBuilderRequestFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext ctx) { UriBuilder baseBuilder = ctx.getUriInfo().getBaseUriBuilder(); UriBuilder requestBuilder = ctx.getUriInfo().getRequestUriBuilder(); processProtocolHeader(ctx, baseBuilder, requestBuilder); processHostHeader(ctx, baseBuilder, requestBuilder); processPortHeader(ctx, baseBuilder, requestBuilder); }  }
UriBuilderRequestFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext ctx) { UriBuilder baseBuilder = ctx.getUriInfo().getBaseUriBuilder(); UriBuilder requestBuilder = ctx.getUriInfo().getRequestUriBuilder(); processProtocolHeader(ctx, baseBuilder, requestBuilder); processHostHeader(ctx, baseBuilder, requestBuilder); processPortHeader(ctx, baseBuilder, requestBuilder); }  @Override void filter(ContainerRequestContext ctx); }
UriBuilderRequestFilter implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext ctx) { UriBuilder baseBuilder = ctx.getUriInfo().getBaseUriBuilder(); UriBuilder requestBuilder = ctx.getUriInfo().getRequestUriBuilder(); processProtocolHeader(ctx, baseBuilder, requestBuilder); processHostHeader(ctx, baseBuilder, requestBuilder); processPortHeader(ctx, baseBuilder, requestBuilder); }  @Override void filter(ContainerRequestContext ctx);  }