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

StandaloneAhcWSRequest rewrites application/x-www-form-urlencoded requests body, changes ordering of keys #780

Open
jjoyce0510 opened this issue Jul 22, 2023 · 1 comment

Comments

@jjoyce0510
Copy link

Are you looking for help?

No, just real issue.

Play WS Version (2.5.x / etc)

I'm on 2.6, but I believe this continues to impact all versions.

API (Scala / Java / Neither / Both)

Java

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

N/A

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

11

Expected Behavior

When building the StandaloneAhcWSRequest here, we rewrite the URL form encoded body string using a map. This does not preserve the ordering of keys specified by the user originally, which causes body-based signature verification in a downstream service to fail. Please either a) add a flag to disable this processing or b) Rewrite the body parameters in a way which preserves ordering.

Actual Behavior

I'm using Play to proxy inbound requests on a particular route downstream. The original request comes in with a Raw Body, and I use the bytes directly when creating the downstream request using WSClient. However, the URL encoded content ordering is not preserved when creating the new body. This causes a signature verification to fail in a downstream service. We need this to succeed!

@mkurz
Copy link
Member

mkurz commented Sep 15, 2023

@jjoyce0510 If you provide a pull request I am happy to review, thanks!

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