]> source.dussan.org Git - gitblit.git/commitdiff
Fix raw servlet blob paths not respecting web.forwardSlashCharacter 39/139/1
authorJames Moger <james.moger@gitblit.com>
Sat, 5 Jul 2014 17:06:24 +0000 (13:06 -0400)
committerJames Moger <james.moger@gitblit.com>
Sat, 5 Jul 2014 17:06:24 +0000 (13:06 -0400)
src/main/java/com/gitblit/servlet/RawServlet.java

index 15e036ea30e61f7cacfb48c6ad2f7f55999c7d04..f57ae2c4a50835788f9aef1267ea25e9a7099c1c 100644 (file)
@@ -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) {