{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/3266","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/3266/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/3266/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/issues/3266/events","html_url":"https://github.com/spring-cloud/spring-cloud-netflix/issues/3266","id":378411683,"node_id":"MDU6SXNzdWUzNzg0MTE2ODM=","number":3266,"title":"RequestContext.set(\"requestURI\", \"\") is not routing to correct micro-services","user":{"login":"aswinde03032008","id":37673868,"node_id":"MDQ6VXNlcjM3NjczODY4","avatar_url":"https://avatars1.githubusercontent.com/u/37673868?v=4","gravatar_id":"","url":"https://api.github.com/users/aswinde03032008","html_url":"https://github.com/aswinde03032008","followers_url":"https://api.github.com/users/aswinde03032008/followers","following_url":"https://api.github.com/users/aswinde03032008/following{/other_user}","gists_url":"https://api.github.com/users/aswinde03032008/gists{/gist_id}","starred_url":"https://api.github.com/users/aswinde03032008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aswinde03032008/subscriptions","organizations_url":"https://api.github.com/users/aswinde03032008/orgs","repos_url":"https://api.github.com/users/aswinde03032008/repos","events_url":"https://api.github.com/users/aswinde03032008/events{/privacy}","received_events_url":"https://api.github.com/users/aswinde03032008/received_events","type":"User","site_admin":false},"labels":[{"id":222072230,"node_id":"MDU6TGFiZWwyMjIwNzIyMzA=","url":"https://api.github.com/repos/spring-cloud/spring-cloud-netflix/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-11-07T18:22:39Z","updated_at":"2018-11-08T16:48:35Z","closed_at":"2018-11-08T16:48:35Z","author_association":"NONE","body":"Here is my filter class which extends ZuulFilter\r\n`@Override\r\n\tpublic String filterType() {\r\n\t\treturn \"pre\";\r\n\t}\r\n\r\n\t@Override\r\n\tpublic int filterOrder() {\r\n\t\treturn 6;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean shouldFilter() {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic Object run() {\r\n\t\t\r\n\t\tRequestContext ctx = RequestContext.getCurrentContext();\r\n\t\tHttpServletRequest request = ctx.getRequest();\r\n\t\tString requestUri = request.getRequestURI().split(\";\")[0];\r\n\t\tlog.info(\"@gateway -> Request start  ->{}\", requestUri);\r\n\r\n\t\tif(clientPortalURIs.contains(requestUri)) {\r\n\t\t\tif(request.getHeader(\"http-user\") != null && \"cpTestUser\".equals(request.getHeader(\"http-user\"))){\r\n\t\t\t\tlog.info(\"it is client-portal request so entitlment is not required.\");\r\n\t\t\t}\r\n\t\t\tString url = UriComponentsBuilder.fromHttpUrl(request.getRequestURL().toString().replace(\"navx\", \"navxcp\")).build().toUriString();\r\n\t\t\tlog.info(\"modified request-uri --------------->{}\", url);\r\n\t\t\tctx.put(\"requestURI\", url);\r\n\t\t} else { \r\n                    log.info(\"just forwarded here\");\r\n              }\r\n      return null; \r\n\r\nbootstarp.yml:\r\n`zuul:\r\n  ignoredServices: navxconfig\r\n  add-proxy-headers: true\r\n  sensitive-headers: Cookie,Set-Cookie\r\n  routes:\r\n    web:\r\n      path: /navx/**\r\n      service-id: navxgui\r\n      stripPrefix: false\r\n\r\n    clientportal:\r\n      path: /navxcp/**\r\n      service-id: navxcp\r\n      stripPrefix: false`\r\n\r\nlog.info(\"modified request-uri --------------->{}\", url); -> it is printing correct but request is routed/forwarded to \"navxgui\" micro-service even if requestURI is \"/navxcp\". I was expecting request should be forwarded to \"navxcp\" micro-service\r\n\r\nCan you please let me what goes wrong here?\r\n\r\n"}}
{"actor":{"display_login":"aswinde03032008"}}