Skip to content

Commit

Permalink
revert: Surprising param encoding #900
Browse files Browse the repository at this point in the history
  • Loading branch information
jknack committed Oct 22, 2017
1 parent 3e9bd1b commit c7e8636
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions jooby/src/main/java/org/jooby/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,12 @@
public interface Router {

/**
* Decode a path by delegating to {@link URLDecoder#decode(String, String)}. This function keeps
* the <code>+</code> character.
* Decode a path by delegating to {@link URLDecoder#decode(String, String)}.
*
* @param path Path to decoded.
*/
static String decode(String path) {
return Try.apply(() -> URLDecoder.decode(path.replace("+", "%2b"), "UTF-8")).get();
return Try.apply(() -> URLDecoder.decode(path, "UTF-8")).get();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public void pathVarShouldBeDecoded() throws Exception {

request()
.get("/plus+plus")
.expect("plus+plus");
.expect("plus plus");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void shouldNotEncodingPlusSign() throws Exception {
int ch = '+';
System.out.println(Integer.toHexString(ch));
request().get("/900/a+b")
.expect("a+b");
.expect("a b");
}

}

0 comments on commit c7e8636

Please sign in to comment.