You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has come up before. However, sanitize() was added to our binary() function to address this: c1e41ba
The endpoint to download a submission attachment uses the binary() function. However, while binary() does call sanitize(), it looks like sanitize() doesn't remove non-ASCII characters.
If a change is needed in binary(), I think it'd also be needed elsewhere, as there are places outside binary() where we use sanitize() together with Content-Disposition.
Somewhat relatedly, I'm noticing that we don't call binary() or sanitize() for the endpoint to download a form attachment:
Would it work to specify a filename* parameter to Content-Disposition in addition to filename? Does Express or an existing npm package provide an easy way to specify both parameters?
The text was updated successfully, but these errors were encountered:
Just saw this Sentry issue, which seems related. In this case, it looks like the .csv.zip can't be downloaded, because the form ID contains a Unicode character.
A report on the forum notes that downloading a submission attachment whose filename contains a non-ASCII character results in an error: https://forum.getodk.org/t/error-with-non-ascii-chars-in-attachment-filenames/34462
This has come up before. However,
sanitize()
was added to ourbinary()
function to address this: c1e41baThe endpoint to download a submission attachment uses the
binary()
function. However, whilebinary()
does callsanitize()
, it looks likesanitize()
doesn't remove non-ASCII characters.If a change is needed in
binary()
, I think it'd also be needed elsewhere, as there are places outsidebinary()
where we usesanitize()
together withContent-Disposition
.Somewhat relatedly, I'm noticing that we don't call
binary()
orsanitize()
for the endpoint to download a form attachment:central-backend/lib/resources/forms.js
Lines 208 to 221 in 78833c1
Would it work to specify a
filename*
parameter toContent-Disposition
in addition tofilename
? Does Express or an existing npm package provide an easy way to specify both parameters?The text was updated successfully, but these errors were encountered: