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

Unnecessary response urldecoding fails if response JSON is not a valid urlencoded string #40

Open
kalinochkind opened this issue May 11, 2023 · 0 comments

Comments

@kalinochkind
Copy link

QueryEmail method applies java.net.URLDecoder.decode to the response. However, the response is a JSON, not an urlencoded string.

In most cases this is a no-op, but sometimes it can fail. For example, if the response JSON contains the following location value: "location":"%"
then response parsing fails with the following exception:

java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "","
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:237)
	at java.base/java.net.URLDecoder.decode(URLDecoder.java:147)
	at com.emailage.javawrapper.EmailageClient.QueryEmail(EmailageClient.java:91)
...
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

1 participant