summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-10-26 10:16:49 -0400
committerJames Moger <james.moger@gitblit.com>2014-10-26 10:16:49 -0400
commit9ceddb66153d78fbbc13fc6b1ab24714080ed17a (patch)
tree6e19957a91d2388273acc097ac167579776eacbb
parent94199c8c4d30bd3392d870048e704814d7efd706 (diff)
downloadgitblit-9ceddb66153d78fbbc13fc6b1ab24714080ed17a.tar.gz
gitblit-9ceddb66153d78fbbc13fc6b1ab24714080ed17a.zip
Fix raw servlet trashing paths with spaces
-rw-r--r--releases.moxie2
-rw-r--r--src/main/java/com/gitblit/servlet/RawServlet.java5
2 files changed, 4 insertions, 3 deletions
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) {