Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add http headers values to serialization exception message (#880)
Motivation: When users attempt to deserialize a response that has the wrong content-type, they receive an exception that lists all the headers, but with `<filtered>` as the value, making it hard to diagnose. Modifications: - Add a new debug filter `DEFAULT_DEBUG_HEADER_FILTER` to the class `HeaderUtils`. - Modify the following classes [`DefaultClassHttpDeserializer`, `DefaultTypeHttpDeserializer`, `FormUrlEncodedHttpDeserializer`, `HttpStringDeserializer`] and change the method `checkContentType` to call `headers.toString(DEFAULT_DEBUG_HEADER_FILTER)`. - Add tests to cover the new SerializationException messages. Result: Better debugging info in `SerializationException` when attempting to deserialize invalid `content-type`.
- Loading branch information
1 parent
707d8be
commit d182820
Showing
7 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters