XContentParser Behaves Differently for Stream and Byte Array #61489
Labels
>bug
:Core/Infra/Core
Core issues without another label
help wanted
adoptme
Team:Core/Infra
Meta label for core/infra team
Optimizing
BytesReference
parsing in #61447 revealed a subtle bug in x-content parsing.The following test:
will actually pass until the last line which will throw:
So for reading from streams, we simply read empty map when the type is off but when reading from a byte array we (in my opinion correctly) throw an exception. I think we should throw that same exception when reading from a stream of the wrong content type shouldn't we?
The text was updated successfully, but these errors were encountered: