From: James Moger Date: Sun, 26 Oct 2014 14:16:49 +0000 (-0400) Subject: Fix raw servlet trashing paths with spaces X-Git-Tag: v1.6.2~3^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Ftickets%2F11%2F211%2F1;p=gitblit.git Fix raw servlet trashing paths with spaces --- diff --git a/releases.moxie b/releases.moxie index 222db662..446d1619 100644 --- a/releases.moxie +++ b/releases.moxie @@ -11,11 +11,13 @@ r26: { security: ~ fixes: - Fix French translation (pr-224, ticket-210) + - Fix raw servlet trashing paths with spaces (ticket-211) changes: ~ additions: ~ dependencyChanges: ~ contributors: - Pierre Templier + - Barry Roberts } # diff --git a/src/main/java/com/gitblit/servlet/RawServlet.java b/src/main/java/com/gitblit/servlet/RawServlet.java index ac77646f..ca41d0ab 100644 --- a/src/main/java/com/gitblit/servlet/RawServlet.java +++ b/src/main/java/com/gitblit/servlet/RawServlet.java @@ -104,9 +104,8 @@ public class RawServlet extends DaggerServlet { branch = Repository.shortenRefName(branch).replace('/', fsc); } - String encodedPath = path == null ? "" : path.replace(' ', '-'); - encodedPath = encodedPath.replace('/', fsc); - return baseURL + Constants.RAW_PATH + repository + "/" + (branch == null ? "" : (branch + "/" + (path == null ? "" : encodedPath))); + String encodedPath = path == null ? "" : path.replace('/', fsc); + return baseURL + Constants.RAW_PATH + repository + "/" + (branch == null ? "" : (branch + "/" + encodedPath)); } protected String getBranch(String repository, HttpServletRequest request) {