Add spring7 tests
The bug must have been introduced in Grails 6.1.2 and it seems to also be present in Grails 7.0.0 ...
Hi,
In your code, you forget absolute:false.
The bug introduced between grails 5.2X (https://github.com/apache/grails-core/blob/5.2.x/grails-web-url-mappings/src/main/groovy/grails/web/mapping/ResponseRedirector.groovy#L125) and grails 5.3.X (https://github.com/apache/grails-core/blob/5.3.x/grails-web-url-mappings/src/main/groovy/grails/web/mapping/ResponseRedirector.groovy#L125)
Probably a dumb question, but may I ask the use case for first creating a url with the LinkGenerator and then passing that url to redirect() (where the LinkGenerator will be invoked again) instead of calling redirect() directly?
From the example application provided: https://github.com/imranmir/redirect-issue
class TestController {
LinkGenerator grailsLinkGenerator
def index() {
def url = grailsLinkGenerator.link(controller: 'menu', action: 'home')
redirect(url: url)
}
// vs
def index2() {
redirect(controller: 'menu', action: 'home')
}
}
The linkGenerator.link call comes from a legacy helper method that’s responsible for generating links dynamically. Redirecting with that link is just one of the things it does — the same link is also passed to JavaScript and used in a few other places. So we end up reusing that generated link in redirect() instead of calling redirect() directly.
Fixed by https://github.com/apache/grails-core/pull/15227
Reverts changes for https://github.com/apache/grails-core/issues/11673