Comments (10)
The error message is actually wrong, Netty 3 doesn't properly handle BAD_REQUEST status code: netty/netty#441
@cstamas I know this is an old issue, but would you have a simple test case (server side) so I can investigate, please?
from async-http-client.
I have a Gatling user who kindly provided a test case: https://docs.google.com/file/d/0B1zTVlhQrNiyZ01CZDFDWm5QYlk/edit
Installation instructions:
- download node: http://nodejs.org/download
- go into unzipped project root and `npm install``
node index.js
Send POST requests to localhost:3000/post/test, XML bodies, compressed on not, will be printed in the console.
RequestBuilder requestBuilder = new RequestBuilder("POST");
requestBuilder.setUrl("http://localhost:3001/post/test");
requestBuilder.setBody("<foo>bar</foo>".getBytes());
Request request = requestBuilder.build();
AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder().setRequestCompressionLevel(6).build();
AsyncHttpClient client = new AsyncHttpClient(config);
// AsyncHttpClient client = new AsyncHttpClient(); // works perfectly when no request compression
try {
client.executeRequest(request).get();
} finally {
client.close();
}
Note that IllegalStateException: cannot send more responses than requests
is actually Netty not properly handling BAD_REQUEST status code.
from async-http-client.
NettyAsyncHttpProvider wrongly uses a HttpContentCompressor
, which is a HttpContentEncoder
, that, as doc states, is only used for encoding responses, not requests!
Actually, Netty doesn't support request compression yet. See netty/netty#2131 and netty/netty#2132
from async-http-client.
@jfarcand As this is a Netty feature request, I don't know when it will be implemented and I doubt it will be backported on Netty 3.
I say that we remove the feature for now, both in AHC1 and AHC2. This won't cause regression is AHC1 because no user could possibly use it: it just makes the request break.
from async-http-client.
Change title
from async-http-client.
Agree. Closing as won't fix.
from async-http-client.
@jfarcand I disagree. I've been asked for this feature on Gatling and had to implement it on my own, and it's not great and I'd rather have it supported in Netty.
Let's just turn what first was an issue into a feature request (I did one on Netty).
from async-http-client.
No activity there for a very long time. Closing for now.
from async-http-client.
@slandelle I know you'd prefer to see this implemented in Netty, but what do you think about adding this to AHC until Netty finally supports request compression?
I think it'd be doable using just a RequestFilter
, if that helps. And if you're leery about polluting the config class with more options we could just include a GzipRequestFilter
in AHC and let people manually add it to the request filters in the config themselves.
If you think it's worth considering, I can open a PR. Let me know.
from async-http-client.
I don't think that would work with every kinds of response bodies.
I think the only way to implement it is to have a Netty handler, similar to the one use for compressing server side.
from async-http-client.
Related Issues (20)
- Why did the bom get removed? HOT 2
- Request new release to incorporate changes for Netty vulns to pass CVE scans. HOT 1
- [Question] Using java.time.Duration for timeouts and ttls HOT 2
- Is there a way to reuse AsyncHttpClient asynchronously for different proxy servers? HOT 2
- Integrating async-http-client into OSS-Fuzz HOT 3
- Remove `Authorization` header on redirects? HOT 1
- JakartaEE Release??? HOT 4
- Add configuration options to enable HttpClientCodec.allowDuplicateContentLengths flag HOT 1
- The code seems to spam org.asynchttpclient.netty.channel.NettyChannelConnector$1.operationComplete() HOT 4
- GetResponseBody() seems to crash, return no errors HOT 1
- Is hostname certifcate validation enabled by default? HOT 1
- How to use SSL proxy with AHC HOT 5
- Exception `java.util.NoSuchElementException: socks` when making https request with socks5 proxy HOT 2
- Shutdown is slow
- Remotely closed RemotelyClosedException
- Netty security issues (CVE-2022-41915 and CVE-2021-43797) HOT 1
- Netty security issues (CVE-2022-41915 and CVE-2021-43797) HOT 3
- use promise mode,MaxConnectionSemaphore do not relase lock until channel close. HOT 2
- Invalid Status code=400 text=Bad Request
- JakartaEE and Java 21 issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-http-client.