@Override
			protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
					FilterChain filterChain) throws ServletException, IOException {
				HttpServletRequest req = request;
				String requestURI = request.getRequestURI();
				if (!requestURI.startsWith(EurekaConstants.DEFAULT_PREFIX + "/v2")
						// don't forward static requests (images, js, etc...) to /v2
						&& !staticPattern.matcher(requestURI).matches()) {

					String prefix = EurekaConstants.DEFAULT_PREFIX;
					if (StringUtils.hasText(contextPath)) {
						prefix = contextPath + prefix;
					}
					String updatedPath = EurekaConstants.DEFAULT_PREFIX + "/v2" + requestURI.substring(prefix.length());
					if (StringUtils.hasText(contextPath)) {
						updatedPath = contextPath + updatedPath;
					}
					final String computedPath = updatedPath;
					// only used if a special debug property is set, so in prod this is
					// always skipped.
					if (addDebugResponseHeader) {
						response.addHeader(debugResponseHeader, computedPath);
					}
					HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper(request) {
						@Override
						public String getRequestURI() {
							return computedPath;
						}

						@Override
						public String getServletPath() {
							return computedPath;
						}
					};
					req = wrapper;
				}
				filterChain.doFilter(req, response);
			}
Register the Jersey filter.
@param eurekaJerseyApp an {@link Application} for the filter to be registered
@return a jersey {@link FilterRegistrationBean}
spring-cloud-netflix-eureka-server/src/main/java/org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.java