-
Improvement
-
Resolution: Fixed
-
Major
-
4.1.0
-
None
-
None
-
4.3 RC4
In
org.ametys.plugins.explorer.resources.readers.AmetysResourceReader.setup(SourceResolver, Map, String, Parameters)
there is a portion of code that set the header to attachment, with the filename
String name = _object.getName(); String encodedName = null; try { URI uri = new URI(null, null, name, null); encodedName = uri.toASCIIString(); // EXPLORER-358 : Fix for Chrome which does not support comma in filename encodedName = encodedName.replaceAll(",", "%2C"); } catch (URISyntaxException e) { // do nothing and send no encoded name } name = name.replaceAll("\\\\", "\\\\\\\\"); name = name.replaceAll("\\\"", "\\\\\\\""); response.setHeader("Content-Disposition", "attachment; filename=\"" + (encodedName != null ? encodedName : name) + "\"" + (encodedName != null ? ";filename*=UTF-8''" + encodedName : ""));
The exact same code is used in
org.ametys.plugins.serverdirectory.CheckPathAccessAction._setHeader(String, Response)
It should be mutualized.
Note : in serverdirectory, the character ";" is handled, and not in AmetysResourceReader (at the time of creation of this ticket)
- Dépend de
-
RUNTIME-3303 '/' and ':' are mishandled by URLEncode.encodePath
- Closed