We are using Spring Cloud Gateway (MVC version) in front o a Rails service (let's call it mailbox) and are struggling when the value of a query parameter includes the + (plus) character. Here is an example:
- Client sends a request to the gateway with
[email protected] - Gateway decodes the parameter value, turning
+into a space. - Before sending the request to
mailbox, it encodes back the value, resulting inemail=bob%[email protected] - When receiving this param,
mailboxdecodes it asemail=bob [email protected]which makes it fail
An alternative was to encode + in the client, but then we have:
- Client sends a request to the gateway with
?email=bob%[email protected] - Gateway decodes the parameter value, turning
%2Binto+. - Before sending the request to
mailbox, it encodes back the value but, given that+is not considered special character, it stays as[email protected] - When receiving this param,
mailboxdecodes it asemail=bob [email protected]which makes it fail
I can't find a way to either tell gateway not to decode the original request or force it to encode + before sending the request to mailbox. Is there any way to do that? Is there any other solution? I can't think of anything. It's like all the steps taken are okay (first decode, then encode), but the final result is wrong. I need mailbox to receive an email with a + in it, but I can't.
Thanks for your help!