You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if a URL contains a %2F, e.g. http://localhost:8080/api/v1/permissionrole/permission/get%2Fabc, the HttpServletRequest.getRequestURI could return the raw uri correctly, but the FilterTools.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 by FilterTools.getRelativePath.
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:
url_encode = encodeURL(URL) (in JavaScript language). Then put url_encode into address bar,
open the setting: send url by UTF-8 in browser. And then change the % to %25.
lepe
pushed a commit
to Intellisrc/spark
that referenced
this issue
Aug 11, 2022
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, #553.
Thanks.
spark/src/main/java/spark/servlet/FilterTools.java
Line 55 in c697d98
The text was updated successfully, but these errors were encountered: