Skip to content

Commit

Permalink
code: Support + char in filename at code browser
Browse files Browse the repository at this point in the history
See: Yona Github issue #393
  • Loading branch information
doortts committed Jul 6, 2018
1 parent c876a92 commit 61af6c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/utils/HttpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ public static Boolean isPJAXRequest(Http.Request request){
*/
public static String decodePathSegment(String pathSegment) throws UnsupportedEncodingException {
if (pathSegment != null) {
return URLDecoder.decode(pathSegment, "UTF-8");
// + char in filename is treated specially
String preTransformed = pathSegment.replaceAll("\\+", "*");
String encoded = URLDecoder.decode(preTransformed, "UTF-8");
return encoded.replaceAll("\\*", "+");
} else {
return null;
}
Expand Down

0 comments on commit 61af6c8

Please sign in to comment.