-
Notifications
You must be signed in to change notification settings - Fork 202
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
Using a semicolon in a value in QueryParameters suddenly doesn't work anymore #3955
Comments
@dcristolovean Thanks for opening the issue, I will work on reproducing this in my local environment and get back to you. |
I did log the url with an interceptor and it seems the values are sent correctly (I think), as "x;y;z". Still the server now says it only gets "x". The thing is I also tried to encode them, I can see the query parameters with %3B as soon as I pass them to Amplify, but the final url I see in the interceptor is still with ";" So I would say double failure here :) . 1. Why does Amplify change my %3B to ";" in the final URL. 2. (this surely is not for you) Why does my AWS Rest API not understand "x;y" ? Everything worked for weeks so far, just suddenly it doesn't work anymore. |
@dcristolovean What was the version you upgraded from? |
2.45.x ....something less than 4 :) I don't remember. 1, 2 or 3 :) |
Is it possible that a previous Amplify version was just encoding the ";" by itself ? That would explain why my server worked for me, even if I never encoded myself the ";" ? |
Yeah.. That could definitely be possible, I don't see anything that changed from 2.45.0 to 2.45.4 that should affect encoding. Are you able to test this in the following 3 versions by manually setting the version in SPM?
And validate if you are seeing the same issue, atleast that would validate the hypothesis of something going wrong in one of the recent versions of Amplify Swift. |
This is getting even more interesting: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html Nice. But.. the problem is that now I can't send ";" encoded, as seen, Amplify removes my encoding. |
OK, more info:
class RESTInterceptor: URLRequestInterceptor {
} Yes, this is the most horrific workaround you've ever seen, I know :). BUT IT WORKS. Considering I'm also hitting your AWS REST APIs, this is clearly a problem. It seems it never worked in Amplify, my bad. But it worked for years in AWSMobileClient, I was always sending "x;y;z" and the SDK was handling it correctly. And it works on Android, that SDK never replaces his encoding and leaves it as it is. Let me know if you consider this an Amplify bug (which 100% it is :) ) and how to proceed from here. |
@dcristolovean Thanks for getting back and providing these details.. I'll keep this issue open as a bug, as Amplify Swift seems to be not doing encoding correctly whereas Android does. I'll keep this at relatively lower priority since you have workaround and its not blocking you. |
Describe the bug
I'm calling a REST API with some query parameters ([String : String]). The API call worked for months now. One value in the query is a string like "X;Y".
The server now receives only X and not the entire string.
I put this query dict in a RESTRequest that is simply passed to Amplify.API.get.
Any ideas what happened ? It might coincide with the update to 2.45.4 I did a few days ago.
PS: This suddenly became a huge issue, I realized I have values like this in 99% of the API calls. Having a ";" in any value in the query parameters, simply removes everything what's after the 1st semicolon.
I tried encoding it (%3B), not encoding it, nothing works. Amplify just kills it.
Steps To Reproduce
Expected behavior
The server should receive the entire string, not only what's before the semicolon.
Amplify Framework Version
2.45.4
Amplify Categories
API
Dependency manager
Swift PM
The text was updated successfully, but these errors were encountered: