Browse Source

Fix raw servlet trashing paths with spaces

tags/v1.6.2
James Moger 9 years ago
parent
commit
9ceddb6615
2 changed files with 4 additions and 3 deletions
  1. 2
    0
      releases.moxie
  2. 2
    3
      src/main/java/com/gitblit/servlet/RawServlet.java

+ 2
- 0
releases.moxie View File

@@ -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
}

#

+ 2
- 3
src/main/java/com/gitblit/servlet/RawServlet.java View File

@@ -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) {

Loading…
Cancel
Save