[ 
https://issues.apache.org/jira/browse/WW-5867?focusedWorklogId=1056565&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1056565
 ]

ASF GitHub Bot logged work on WW-5867:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Nov/26 05:34
            Start Date: 23/Nov/26 05:34
    Worklog Time Spent: 10m 
      Work Description: rootvector2 commented on PR #2150:
URL: https://github.com/apache/struts/pull/2150#issuecomment-7092530023

   Reworded the commit headline to `WW-5867 fix(jasperreports): quote the 
Content-Disposition filename` and folded the inline nits into the same commit 
(`15bdd66`). Both plugin suites still pass locally (jasperreports 17/17, 
jasperreports7 24/24). Agreed on `filename*` for non-ASCII names, I will keep 
that as a separate change.




Issue Time Tracking
-------------------

    Worklog Id:     (was: 1056565)
    Time Spent: 20m  (was: 10m)

> JasperReports results write the Content-Disposition filename unquoted
> ---------------------------------------------------------------------
>
>                 Key: WW-5867
>                 URL: https://issues.apache.org/jira/browse/WW-5867
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JasperReports
>            Reporter: Lukasz Lenart
>            Priority: Major
>             Fix For: 7.6.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {{JasperReportsResult}} (plugin {{struts2-jasperreports-plugin}}) and 
> {{JasperReport7Result}} (plugin {{struts2-jasperreports7-plugin}}) build the 
> {{Content-disposition}} header by appending {{documentName}} + {{.}} + format 
> as a bare token:
> {code}
> inline; filename=sales report.pdf
> {code}
> When the document name contains a space, {{;}}, {{"}} or a control character 
> — common once {{documentName}} is an expression such as {{${title}}} 
> evaluated against the value stack — the {{filename}} parameter is cut short 
> or split, and browsers save the file under a truncated or wrong name.
> h2. Proposed change
> Write the file name as a quoted-string (RFC 6266 / RFC 9110): wrap it in 
> double quotes, escape {{"}} and {{\}}, drop control characters.
> {code}
> inline; filename="sales report.pdf"
> {code}
> Applies to both plugins. Update the {{documentName}} Javadoc to show the 
> quoted form.
> h2. Tests
> A test in each plugin asserting the header value for a document name 
> containing a space, {{;}}, {{"}} and a control character.
> Contributed by Naveed Khan (rootvector2) in 
> https://github.com/apache/struts/pull/2150.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to