eclipse-ee4j / eclipse-ee4j/jersey

[JerseyWebTarget] QueryParam not complete encoded

Open
#5,249 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Hello,

I have to report that I noticed that the WebTarget from Jersey Client (Version 2.37) is not encoding query parameters correctly.
We are using it to send a password and that is how we noticed, that something is happening. Currently, we encode the password before we set it as query parameters.

An exception is also thrown:
java.lang.IllegalArgumentException: Illegal character ";" at position 76 is not allowed as a part of a name in a path template "UserLogin=(MYLOGIN)&Password=%C3%98%C3%92%C3%8C%C3%A9%C2%A2%C3%A2%5Bi{ùÁe;ª3jË6ð1nLB/X¢.
Please notice that (MYLOGIN) is not the correct UserLogin and the correct UserLogin was replaced in order to post this issue.

Example:
- Plain password:
ØÒÌé¢â[i{ùÁe;ª3jË6ð1nLB/X¢
- From JettyWebTarget encoded:
%C3%98%C3%92%C3%8C%C3%A9%C2%A2%C3%A2%5Bi{ùÁe;ª3jË6ð1nLB/X¢
- From Java URLEncoder with StandardCharsets UTF8:
%C3%98%C3%92%C3%8C%C3%A9%C2%A2%C3%A2%5Bi%7B%C3%B9%C3%81e%3B%C2%AA3j%C3%8B6%C3%B01nLB%2FX%C2%A2

As you see, JettyWebTarget is not encoding the query parameter to 100%.

Please check and let me know if this issue was not opened in the correct forum. I also searched, but could not find another issue related to this problem.

Best regards

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.