Fix the `Download Diff` issue in Chrome (v16 or newer) when filename has comma(s).

Review Request #6786 — Created Jan. 16, 2015 and submitted — Latest diff uploaded

Information

Review Board
master
0dad998...

Reviewers

If a diff file with a comma in the filename was uploaded via the web UI, clicking "Download Diff" could present an error about "Multiple Content-Disposition" when running with Chrome 16 or newer.

The problem is that we use the Content-Disposition header to tell the browser what filename to save as, but commas in this header are interpreted as multiple values.

To fix this, before we assemble the Content-Disposition header, we replace all commas in the diffset filename with underscores.

  • Wrote a unit test, in the test, I set the diffset.name as 'test, comma'.
  • Unit test passed.
  • Unit test failed whitout the fix.
    Loading...