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

URl gets doubleencoded #8

Open
ybuechler opened this issue Oct 14, 2023 · 2 comments
Open

URl gets doubleencoded #8

ybuechler opened this issue Oct 14, 2023 · 2 comments
Assignees

Comments

@ybuechler
Copy link

ybuechler commented Oct 14, 2023

When using Meta-URL the URL Parameter 'url' gets encoded into URL String twice. This results in an wrong encoding

Example:
URL to encode: https://google.com
correctly encoded URL: https%3A%2F%2Fgoogle.com
Encoding from this tool: https%253A%252F%252Fgoogle.com

Maybe it is resulting from this issue: https://bz.apache.org/bugzilla/show_bug.cgi?id=39746

Workaround for me is to decode the URL twice on the receiving end.

Without checking the code out. Maybe the issue is in the class "NFC4PC" where you encode the URL on Line 153 and then add it to the URL with the method "appendUri" in that method you write that the append String will be URL encoded. That would mean that the URL gets encoded twice and would explain the behaviour.

@martinpaljak
Copy link
Owner

Confirmed. Not related to the mentioned issue, comes from Java.

@martinpaljak
Copy link
Owner

OK. It seems that according to all RFC-s etc (nice rabbithole), the URL should not be encoded at all. Which is also the behaviour coming out of Java URI methods by default. So I'll remove the encoding (which results in double encoding, as % is special), but this also means that you need to be able to handle

@martinpaljak martinpaljak self-assigned this Oct 24, 2023
martinpaljak added a commit that referenced this issue Oct 26, 2023
appendUri constructs a new URI, which will urlencode the payload as needed
martinpaljak added a commit that referenced this issue Oct 26, 2023
appendUri constructs a new URI, which will urlencode the payload as needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants