play1 icon indicating copy to clipboard operation
play1 copied to clipboard

Play 1.7 WS problem (header too large)

Open qabi opened this issue 3 years ago • 2 comments

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

qabi avatar Dec 08 '22 12:12 qabi

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);
+        }

rakix avatar Dec 09 '22 04:12 rakix

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 :)

qabi avatar Dec 09 '22 06:12 qabi