private boolean isMissionControlAccesPoint(ContainerRequest request) { String baseUrl = request.getBaseUri().toString(); baseUrl = PathUtils.trimLeadingSlashes(baseUrl); baseUrl = PathUtils.trimTrailingSlashes(baseUrl); if (baseUrl.endsWith("/mc")) { return true; } return false; }
@Override public ContainerRequest filter(final ContainerRequest request) { if (log.isDebugEnabled()) { log.debug("request.getAbsolutePath : " + request.getAbsolutePath()); log.debug("request.getBaseUri : " + request.getBaseUri()); } RequestContext.clearRequestContext(); RequestContext ctx = new RequestContext( UriBuilder.fromUri(request.getBaseUri()), request.getHeaderValue(RequestContext.HATEOAS_OPTIONS_HEADER)); RequestContext.setRequestContext(ctx); return request; }
@Override public ContainerRequest filter(ContainerRequest containerRequest) { try { // Calling setURIs method clears the cached method, path etc. containerRequest.setUris( containerRequest.getBaseUri(), new URI(containerRequest.getRequestUri().toString().replace("/ws/", "/"))); } catch (URISyntaxException e) { e.printStackTrace(); } return containerRequest; }