From 58562a1348536c460547329c6b1aa2c1ebc4665f Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 5 Jul 2014 13:06:24 -0400 Subject: [PATCH] Fix raw servlet blob paths not respecting web.forwardSlashCharacter --- src/main/java/com/gitblit/servlet/RawServlet.java | 11 ++++++----- 1 file 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 15e036ea..f57ae2c4 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) { -- 2.39.5