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

security: ~ security: ~
fixes: fixes:
- Fix French translation (pr-224, ticket-210) - Fix French translation (pr-224, ticket-210)
- Fix raw servlet trashing paths with spaces (ticket-211)
changes: ~ changes: ~
additions: ~ additions: ~
dependencyChanges: ~ dependencyChanges: ~
contributors: contributors:
- Pierre Templier - Pierre Templier
- Barry Roberts
} }


# #

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

branch = Repository.shortenRefName(branch).replace('/', fsc); 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) { protected String getBranch(String repository, HttpServletRequest request) {

Loading…
Cancel
Save