jamesfredley commented on code in PR #15335:
URL: https://github.com/apache/grails-core/pull/15335#discussion_r2725641655
##########
grails-mimetypes/src/main/groovy/org/grails/web/mime/HttpServletRequestExtension.groovy:
##########
@@ -75,7 +76,17 @@ class HttpServletRequestExtension {
static MimeType[] getMimeTypes(HttpServletRequest request) {
MimeType[] result = (MimeType[])
request.getAttribute(GrailsApplicationAttributes.REQUEST_FORMATS)
if (!result) {
- WebApplicationContext context =
WebApplicationContextUtils.getWebApplicationContext(request.servletContext)
+ // First try to get context from GrailsWebRequest (more reliable
in tests with parallel execution)
Review Comment:
I had the same concern until stumbling on the following, there are also a
few other reasons in the PR description above, but this was the one that made
be lean towards fixing the production code.
**Consistency with `HttpServletResponseExtension`**: The sister class
`HttpServletResponseExtension.getMimeTypes()` already uses
`GrailsWebRequest.lookup()` as the primary lookup method. This change makes
`HttpServletRequestExtension` consistent.
--
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]