{"action":"created","issue":{"url":"https://api.github.com/repos/grails/grails-core/issues/9196","labels_url":"https://api.github.com/repos/grails/grails-core/issues/9196/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-core/issues/9196/comments","events_url":"https://api.github.com/repos/grails/grails-core/issues/9196/events","html_url":"https://github.com/grails/grails-core/issues/9196","id":102155916,"number":9196,"title":"URL Mappings overwriting URI and causing redirect issues in Interceptor After()","user":{"login":"orubel","id":274764,"avatar_url":"https://avatars.githubusercontent.com/u/274764?v=3","gravatar_id":"","url":"https://api.github.com/users/orubel","html_url":"https://github.com/orubel","followers_url":"https://api.github.com/users/orubel/followers","following_url":"https://api.github.com/users/orubel/following{/other_user}","gists_url":"https://api.github.com/users/orubel/gists{/gist_id}","starred_url":"https://api.github.com/users/orubel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orubel/subscriptions","organizations_url":"https://api.github.com/users/orubel/orgs","repos_url":"https://api.github.com/users/orubel/repos","events_url":"https://api.github.com/users/orubel/events{/privacy}","received_events_url":"https://api.github.com/users/orubel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/grails/grails-core/labels/Cannot%20Reproduce","name":"Cannot Reproduce","color":"207de5"},{"url":"https://api.github.com/repos/grails/grails-core/labels/Incomplete","name":"Incomplete","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":44,"created_at":"2015-08-20T14:44:56Z","updated_at":"2015-08-23T01:47:19Z","closed_at":"2015-08-20T16:20:01Z","body":"I needed to set a dynamic naming to my api (much like multitenancy) so I was pulling this in via config with @Value but setting dynamic properties outside the 'static mapping' and then trying to pull them in doesn't work. So I switched to using a wildcard in the front of the URI in url mappings like so:\r\n\r\n    static mappings = {\r\n        \"/*/$controller/$action?/$id?(.$format)?\"{\r\n            controller = controller\r\n            action = action\r\n            parseRequest = true\r\n        }\r\n    }\r\n\r\nNow this is perfectly fine as I can now filter these results in the Interceptor thus saving on filtering twice.\r\n\r\nHowever, in the after() method in the interceptor, any type of redirect/chain/forward, sees the URI as '\"/*/$controller/$action' when forwarding.\r\n\r\nSince we are doing a redirect, should current URI be being accepted and it that IS the current URI, can we replace in interceptor after filtering?\r\n\r\nURLMapping can have wildcards and this is acceptable from what I have read and how they function, so redirect/forwards and chain need to adapt for a SENT uri and not the urlmapping.\r\n\r\nAt least this is what it seems like it is doing?\r\n\r\nTest app is at https://github.com/orubel/testapp\r\n\r\nreferences: #9194 and #600"},"comment":{"url":"https://api.github.com/repos/grails/grails-core/issues/comments/133769867","html_url":"https://github.com/grails/grails-core/issues/9196#issuecomment-133769867","issue_url":"https://api.github.com/repos/grails/grails-core/issues/9196","id":133769867,"user":{"login":"jeffbrown","id":15482,"avatar_url":"https://avatars.githubusercontent.com/u/15482?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbrown","html_url":"https://github.com/jeffbrown","followers_url":"https://api.github.com/users/jeffbrown/followers","following_url":"https://api.github.com/users/jeffbrown/following{/other_user}","gists_url":"https://api.github.com/users/jeffbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbrown/subscriptions","organizations_url":"https://api.github.com/users/jeffbrown/orgs","repos_url":"https://api.github.com/users/jeffbrown/repos","events_url":"https://api.github.com/users/jeffbrown/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbrown/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T01:47:19Z","updated_at":"2015-08-23T01:47:19Z","body":"> tests can be found at https://github.com/orubel/testapp/blob/master/src/integration-test/groovy/testapp/MappingConfigFunctionalSpec.groovy\r\n\r\nIt appears that the original repo that the link there points to has since been deleted.  For continuity and reference for anyone looking at this in the future, another copy of that same test is available at https://github.com/jeffbrown/testapp/blob/32145908fc2e7b0a2ffd624f891d8e34d41c53e0/src/integration-test/groovy/testapp/MappingConfigFunctionalSpec.groovy\r\n\r\nThat test evolved quite a bit after that point.  A more recent version is at https://github.com/jeffbrown/testapp/blob/34ab08025a5e5989bc468271f1c52b7c58e27688/src/integration-test/groovy/testapp/MappingConfigFunctionalSpec.groovy"}}