diff options
author | James Moger <james.moger@gitblit.com> | 2014-07-05 11:10:40 -0600 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-07-05 11:10:40 -0600 |
commit | dc9af4ce8b21d1f586a3f3dcdc3d6ededdee738c (patch) | |
tree | 6ee22e3721f287344fdc9f105d6374f6fef42efc | |
parent | aa4f732bc3e285dc1433af358c89ab54c90f0d50 (diff) | |
parent | 58562a1348536c460547329c6b1aa2c1ebc4665f (diff) | |
download | gitblit-dc9af4ce8b21d1f586a3f3dcdc3d6ededdee738c.tar.gz gitblit-dc9af4ce8b21d1f586a3f3dcdc3d6ededdee738c.zip |
Merged #139 "Raw link blob paths do not respect web.forwardSlashCharacter"
-rw-r--r-- | src/main/java/com/gitblit/servlet/RawServlet.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/com/gitblit/servlet/RawServlet.java b/src/main/java/com/gitblit/servlet/RawServlet.java index 0cda59ab..6e933076 100644 --- a/src/main/java/com/gitblit/servlet/RawServlet.java +++ b/src/main/java/com/gitblit/servlet/RawServlet.java @@ -95,16 +95,17 @@ public class RawServlet extends DaggerServlet { baseURL = baseURL.substring(0, baseURL.length() - 1); } + char fsc = '!'; + char c = GitblitContext.getManager(IRuntimeManager.class).getSettings().getChar(Keys.web.forwardSlashCharacter, '/'); + if (c != '/') { + fsc = c; + } if (branch != null) { - char fsc = '!'; - char c = GitblitContext.getManager(IRuntimeManager.class).getSettings().getChar(Keys.web.forwardSlashCharacter, '/'); - if (c != '/') { - fsc = c; - } branch = branch.replace('/', fsc); } String encodedPath = path == null ? "" : path.replace(' ', '-'); + encodedPath = encodedPath.replace('/', fsc); try { encodedPath = URLEncoder.encode(encodedPath, "UTF-8"); } catch (UnsupportedEncodingException e) { |