jdaugherty commented on code in PR #15801:
URL: https://github.com/apache/grails-core/pull/15801#discussion_r3506391145
##########
grails-controllers/src/main/groovy/grails/artefact/controller/support/ResponseRenderer.groovy:
##########
@@ -520,8 +518,12 @@ trait ResponseRenderer extends WebAttributes {
}
private boolean applyContentType(HttpServletResponse response, Map argMap,
Object renderArgument, boolean useDefault) {
+ applyContentType(response, argMap, renderArgument, useDefault,
TEXT_HTML)
+ }
+
+ private boolean applyContentType(HttpServletResponse response, Map argMap,
Object renderArgument, boolean useDefault, String defaultContentType) {
boolean contentTypeIsDefault = true
- String contentType = resolveContentTypeBySourceType(renderArgument,
useDefault ? TEXT_HTML : null)
+ String contentType = resolveContentTypeBySourceType(renderArgument,
useDefault ? defaultContentType : null)
Review Comment:
I'm not sure we should use a default content type. Especially plain text
when encoders could cause non-text values to render.
--
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]