dakshmehta007 opened a new pull request, #14092:
URL: https://github.com/apache/grails-core/pull/14092
Added support for HTTP 307/308 status codes in the ResponseRedirector by:
Fixes #11625
1. Extending the redirect logic to check for a `tempRedirect` flag in the
statusConfig
2. Using appropriate status codes based on permanent + tempRedirect flags:
- permanent: false, tempRedirect: false -> 302 (default)
- permanent: true, tempRedirect: false -> 301
- permanent: false, tempRedirect: true -> 307
- permanent: true, tempRedirect: true -> 308
3. Added test cases to verify both temporary (307) and permanent (308)
redirect behavior
## Usage##
```groovy
**For 307 Temporary Redirect**
request.setAttribute('statusConfig', [tempRedirect: true])
redirect(action: 'foo')
**For 308 Permanent Redirect**
request.setAttribute('statusConfig', [tempRedirect: true])
redirect(action: 'foo', permanent: true)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]