bito-code-review[bot] commented on PR #16386:
URL: https://github.com/apache/grails-core/pull/16386#issuecomment-5818542564

   <!-- Bito Reply -->
   The current implementation of `applyFileDisposition` already handles the 
`inline` argument by returning early if `argMap.get('inline')` is true, which 
effectively leaves any existing `Content-Disposition` header (or lack thereof) 
alone. To explicitly document this behavior in the reference documentation, you 
can update the `render` method entry in 
`grails-doc/src/en/ref/Controllers/render.adoc` to clarify that setting 
`inline: true` takes precedence over `fileName:` and prevents the automatic 
attachment disposition.
   
   
**grails-controllers/src/main/groovy/grails/artefact/controller/support/ResponseRenderer.groovy**
   ```
   private void applyFileDisposition(HttpServletResponse response, Map argMap, 
String fileName) {
           if (response.getHeader(HttpHeaders.CONTENT_DISPOSITION) != null) {
               return
           }
           if (Boolean.TRUE.equals(argMap.get('inline'))) {
               return
           }
           String disposition = fileName ? 
"$DISPOSITION_HEADER_PREFIX\"${escapeContentDispositionFilename(fileName)}\"" : 
'attachment'
           response.setHeader(HttpHeaders.CONTENT_DISPOSITION, disposition)
       }
   ```


-- 
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]

Reply via email to