{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/118","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/118/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/118/events","html_url":"https://github.com/spring-cloud/spring-cloud-consul/issues/118","id":119958218,"number":118,"title":"llegal value to be added to the service's tags '/'","user":{"login":"domelz","id":10674576,"avatar_url":"https://avatars.githubusercontent.com/u/10674576?v=3","gravatar_id":"","url":"https://api.github.com/users/domelz","html_url":"https://github.com/domelz","followers_url":"https://api.github.com/users/domelz/followers","following_url":"https://api.github.com/users/domelz/following{/other_user}","gists_url":"https://api.github.com/users/domelz/gists{/gist_id}","starred_url":"https://api.github.com/users/domelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domelz/subscriptions","organizations_url":"https://api.github.com/users/domelz/orgs","repos_url":"https://api.github.com/users/domelz/repos","events_url":"https://api.github.com/users/domelz/events{/privacy}","received_events_url":"https://api.github.com/users/domelz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-02T14:52:57Z","updated_at":"2015-12-02T16:11:32Z","closed_at":null,"body":"org.springframework.cloud.discovery.ConsulLifecyle#createTags() has a bug that prevents the '/' character from being replaced which causes an illegal value to be added to the service's tags.\r\n\r\nThe servletContext.getContextPath().replaceAll(\"/\", \"\") will return an updated value if the context path contains any '/' characters, but this updated value is not the value that is being added to the List of \"tags\".\r\n\r\nHere is the 1.0.0.M4 version:\r\n\r\n\tprivate List<String> createTags() {\r\n\t\tList<String> tags = new LinkedList<>(properties.getTags());\r\n\t\tif(servletContext != null\r\n\t\t\t\t&& StringUtils.hasText(servletContext.getContextPath())\r\n\t\t\t\t&& StringUtils.hasText(servletContext.getContextPath().replaceAll(\"/\", \"\"))) {\r\n\t\t\ttags.add(\"contextPath=\" + servletContext.getContextPath());\r\n\t\t}\r\n\t\treturn tags;\r\n\t}\r\n\r\nHere is a corrected version...\r\n\r\n\tprivate List<String> createTags() {\r\n\t\tList<String> tags = new LinkedList<>(properties.getTags());\r\n\t\tif (servletContext != null) {\r\n\t\t\tString contextPath =  servletContext.getContextPath();\r\n\t\t\tif (StringUtils.hasText(contextPath)) {\r\n\t\t\t\tcontextPath = contextPath.replaceAll(\"/\", \"\");\r\n\t\t\t\tif (StringUtils.hasText(contextPath)) {\r\n\t\t\t\t\ttags.add(\"contextPath=\" + contextPath);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn tags;\r\n\t}"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/comments/161348601","html_url":"https://github.com/spring-cloud/spring-cloud-consul/issues/118#issuecomment-161348601","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-consul/issues/118","id":161348601,"user":{"login":"spencergibb","id":594085,"avatar_url":"https://avatars.githubusercontent.com/u/594085?v=3","gravatar_id":"","url":"https://api.github.com/users/spencergibb","html_url":"https://github.com/spencergibb","followers_url":"https://api.github.com/users/spencergibb/followers","following_url":"https://api.github.com/users/spencergibb/following{/other_user}","gists_url":"https://api.github.com/users/spencergibb/gists{/gist_id}","starred_url":"https://api.github.com/users/spencergibb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencergibb/subscriptions","organizations_url":"https://api.github.com/users/spencergibb/orgs","repos_url":"https://api.github.com/users/spencergibb/repos","events_url":"https://api.github.com/users/spencergibb/events{/privacy}","received_events_url":"https://api.github.com/users/spencergibb/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T16:11:32Z","updated_at":"2015-12-02T16:11:32Z","body":"The reason for the check for `/` was to not include a context that was just `/`."}}