Downloading files through azure cdn is failing because url is double encoded when file name has spaces

When the binary data store is set up to use Azure CDN and direct download is enabled, the nxfile servlet is redirecting to the wrong url when the filename has spaces in the name, causing the file to not be downloadable. This does not happen with file names that do not have spaces.

Example of how to emulate below:

  1. a file is uploaded to nuxeo with the name “Hey this is some fake stuff for a fake word document.docx”
  2. try to download the file in the Nuxeo UI
  3. nuxeo nxfile gives a http 302 with the url : http://<_some azure urll>&rscd=attachment%3B%20filename%3DHey%20this%20is% 20some%20fake%20stuff%20for%20a%20fake%20word%20document.docx&sp=r&sr=b (note that spaces are encoded as %20)
  4. Nuxeo then tries to do a redirect to http://<_some azure url_>&rscd=attachment%3B%2520filename%3DHey%2520this%2520is% 20some%2520fake%2520stuff%2520for%2520a%2520fake%2520word%2520document.docx&sp=r&sr=b (note that the %20 is now encoded as %2520

If we manually change the %2520 to %20 in the url, the file is downloadable. This was tested in nuxeo version FT8.2. Is anyone else seeing this issue?

0 votes

0 answers

2313 views

ANSWER