Open miguoliang opened 6 years ago
I would like to work on this issue
I want to use UTF-8 to solve this problem. When the path in URL has %, the user can not put the URL in the address bar in the browser directly. They should encode URL in UTF-8 . There are two ways:
if a URL contains a %2F, e.g.
http://localhost:8080/api/v1/permissionrole/permission/get%2Fabc
, theHttpServletRequest.getRequestURI
could return the raw uri correctly, but theFilterTools.getRelativePath
decoded the %2F in the path. Maybe it's not right.the correct result should be
/api/v1/permissionrole/permission/get%2Fabc
, but/api/v1/permissionrole/permission/get/abc
returned byFilterTools.getRelativePath
.this PR works for this case, https://github.com/perwendel/spark/pull/553.
Thanks.
https://github.com/perwendel/spark/blob/c697d981268c538dfeeb38786bd9eb0a03ab86f0/src/main/java/spark/servlet/FilterTools.java#L55