Skip to content

Commit 9ceddb6

Browse files
committed
Fix raw servlet trashing paths with spaces
1 parent 94199c8 commit 9ceddb6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

releases.moxie

+2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ r26: {
1111
security: ~
1212
fixes:
1313
- Fix French translation (pr-224, ticket-210)
14+
- Fix raw servlet trashing paths with spaces (ticket-211)
1415
changes: ~
1516
additions: ~
1617
dependencyChanges: ~
1718
contributors:
1819
- Pierre Templier
20+
- Barry Roberts
1921
}
2022

2123
#

src/main/java/com/gitblit/servlet/RawServlet.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ public static String asLink(String baseURL, String repository, String branch, St
104104
branch = Repository.shortenRefName(branch).replace('/', fsc);
105105
}
106106

107-
String encodedPath = path == null ? "" : path.replace(' ', '-');
108-
encodedPath = encodedPath.replace('/', fsc);
109-
return baseURL + Constants.RAW_PATH + repository + "/" + (branch == null ? "" : (branch + "/" + (path == null ? "" : encodedPath)));
107+
String encodedPath = path == null ? "" : path.replace('/', fsc);
108+
return baseURL + Constants.RAW_PATH + repository + "/" + (branch == null ? "" : (branch + "/" + encodedPath));
110109
}
111110

112111
protected String getBranch(String repository, HttpServletRequest request) {

0 commit comments

Comments
 (0)