Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In tomcat with -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true, the FilterTools.getRelativePath does not works correctly #1026

Open
miguoliang opened this issue Jun 26, 2018 · 2 comments · May be fixed by #1222
Labels

Comments

@miguoliang
Copy link

miguoliang commented Jun 26, 2018

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.

this PR works for this case, #553.

Thanks.

path = URLDecoder.decode(path, "UTF-8");

@Bugjudger
Copy link

I would like to work on this issue

@Bugjudger
Copy link

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:

  1. url_encode = encodeURL(URL) (in JavaScript language). Then put url_encode into address bar,
  2. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants