Unsupported content encoding to be treated as an error#698
Conversation
|
Hi, I have a problem with this change. w/o specifying any It worked with the previous versions but now the request fails with |
@plesingr-aeb You are doing nothing wrong, but the origin server does. |
|
@ok2c Thanks for the explanation (meanwhile, I also got the issue and a solution as well). But what should I do if I have such a legacy issue and can neither fix it nor use a previous client version (because of some internal update policies)? |
|
@plesingr-aeb One option is to turn off automatic content decompression. A better solution would be to introduce a custom exec interceptor that drops that silly header before the response gets processed by the standard execution pipeline. |
|
@ok2c Sounds good, thanks. |
We also noticed this change in behavior and I wanted to clarify on the reasoning behind that. |
|
@strangelookingnerd You see, the server is not supposed to apply any content encoding other than those the client explicitly requests with If, for whatever reason, your application needs to be able to accept such responses, you must either disable the automatic content decompression and implement your own content processing logic or, alternatively, you may implement an execution interceptor that re-writes the |
|
I understand the reasoning but still wanted to express that there might be corner-cases where this new behavior makes it unnecessarily harder for clients. |
|
@strangelookingnerd Based on my interpretation of the spec it is actually very wrong, unless there is a statement in the specification I have overlooked. Has |
|
There is no definition of no-op, yet there is no other definition either.
One could argue that by above logic But again, I understand your reasoning. Would it be an option to keep the current behavior as default but make it again a configuration/option to ignore invalid values as it was before this change? |
@strangelookingnerd If Httpclient ignores invalid codec values indiscriminately it risks generating garbage content stream. In your specific context Just drop |
Treat unsupported content encoding as an error. @arturobernalg Please double-check