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

Play 1.7 WS problem (header too large) #1434

Open
qabi opened this issue Dec 8, 2022 · 2 comments
Open

Play 1.7 WS problem (header too large) #1434

qabi opened this issue Dec 8, 2022 · 2 comments

Comments

@qabi
Copy link

qabi commented Dec 8, 2022

Are you looking for help?

Requests made through WS do not support response headers longer than 8152 bytes. Some web servers return such long headers.

Netty allows to configure this, but it does not seem to be possible to configure through Play!

Play Version (1.5.x / etc)

1.7.1

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

MacOS and Ubuntu.

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

JDK 17.0.1

@rakix
Copy link

rakix commented Dec 9, 2022

It might work if you fix
framework/src/play/libs/ws/WSAsync.java Constructor

+        if (Play.configuration.containsKey("http.clientMaxHeaderSize")){
+            int clientMaxHeaderSize = Integer.valueOf(Play.configuration.getProperty("http.clientMaxHeaderSize"));
+            NettyAsyncHttpProviderConfig providerConfig = new NettyAsyncHttpProviderConfig();
+            providerConfig.setHttpClientCodecMaxHeaderSize(clientMaxHeaderSize);
+            confBuilder.setAsyncHttpClientProviderConfig(providerConfig);
+        }

@qabi
Copy link
Author

qabi commented Dec 9, 2022

Thanks!

That is essentially what I have done, but with reflection from a subclass, so WSAsync did not have to be copied entirely.

Not a very nice fix, but it works :)

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