atiaomar1978-hub commented on PR #24997:
URL: https://github.com/apache/camel/pull/24997#issuecomment-5048276947

   Thanks @oscerd — you were right on every point, and I appreciate the depth 
of the review.
   
   I verified your central claim empirically: I ran the new test class against 
an **unmodified** `HttpProducer.java` and both tests passed. So they were 
documenting current behaviour, not protecting a fix — the class of bug is 
already fixed on `main` by `4a903e2b8f3c` (entity-based 
`getContentEncoding()`), and `DecompressingEntity.getContentEncoding()` returns 
`null` in httpclient5 5.6.2 as you said.
   
   I also confirmed the guard was a regression: `contentCompressionDisabled` is 
component-level only, so `?httpClient.contentCompressionEnabled=false` (bound 
to `RequestConfig.Builder` in `createHttpClientBuilder`), a 
`httpClientConfigurer` calling `disableContentCompression()`, and a 
user-supplied client all leave it `false` while HttpClient genuinely isn't 
decompressing — my guard would have stripped `Content-Encoding` and skipped 
`GZIPHelper`, handing raw gzip downstream.
   
   Changes pushed (86b54d1):
   
   - **Reverted** `HttpProducer.java` to the entity-based logic on `main` — no 
production change; the guard is gone, and with it the unreachable 
response-header fallback you flagged.
   - **Removed** the duplicated standalone test class (~90 lines).
   - **Consolidated** regression coverage into `HttpCompressionTest`: 
`compressedHttpPost()` now asserts the stale gzip `Content-Encoding` header is 
stripped after auto-decompression (migrated to AssertJ), and I added 
`compressedHttpPostWithEndpointContentCompressionDisabled` covering the 
`?httpClient.contentCompressionEnabled=false` path — the exact case the guard 
would have corrupted.
   - No upgrade-guide entry, since there's no behaviour change.
   
   `mvn test -pl components/camel-http -Dtest=HttpCompressionTest` passes.
   
   If you'd prefer to close this in favour of the existing coverage rather than 
land the extra endpoint-level test, I'm happy either way.
   
   _AI-generated comment on behalf of atiaomar1978-hub_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to