Skip to content

Commit c7e8636

Browse files
committed
revert: Surprising param encoding #900
1 parent 3e9bd1b commit c7e8636

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

jooby/src/main/java/org/jooby/Router.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,12 @@
230230
public interface Router {
231231

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

242241
/**

modules/coverage-report/src/test/java/org/jooby/PathVarMustBeDecodedFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public void pathVarShouldBeDecoded() throws Exception {
1717

1818
request()
1919
.get("/plus+plus")
20-
.expect("plus+plus");
20+
.expect("plus plus");
2121
}
2222
}

modules/coverage-report/src/test/java/org/jooby/issues/Issue900.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void shouldNotEncodingPlusSign() throws Exception {
1818
int ch = '+';
1919
System.out.println(Integer.toHexString(ch));
2020
request().get("/900/a+b")
21-
.expect("a+b");
21+
.expect("a b");
2222
}
2323

2424
}

0 commit comments

Comments
 (0)