Decode file names received by PUT, as we do with file names received by multipart...
authorPanagiotis Astithas <pastith@gmail.com>
Thu, 4 Jun 2009 14:01:16 +0000 (17:01 +0300)
committerPanagiotis Astithas <pastith@gmail.com>
Thu, 4 Jun 2009 14:01:16 +0000 (17:01 +0300)
src/gr/ebs/gss/server/rest/FilesHandler.java

index a8bb93c..f11d086 100644 (file)
@@ -1413,6 +1413,12 @@ public class FilesHandler extends RequestHandler {
         */
        void putResource(HttpServletRequest req, HttpServletResponse resp) throws IOException, FileNotFoundException {
         String path = getInnerPath(req, PATH_FILES);
+               try {
+               path = URLDecoder.decode(path, "UTF-8");
+               } catch (IllegalArgumentException e) {
+                       resp.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
+                       return;
+               }
        if (logger.isDebugEnabled())
                        logger.debug("Updating resource: " + path);