-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBOR: Improve recognition of CBOR data format #7640
Comments
Jackson 2.4.3 now contains the above fixes. We should upgrade and add the changes mentioned above. |
if we get a fix for this I think it should go into |
do we need to do anything else than upgrading jackson? @pickypg do you have a ETA for this? |
I should have this up for review on Monday. We need to change |
Merged |
- Update pom to 2.4.3 from 2.4.2 - Enable the CBOR data header (aka tag) from the CBOR Generator to provide binary identification like the Smile format - Check for the CBOR header and ensure that the data sent in represents a "major type" that is an object - Cleans up `JsonVsCborTests` unused imports Closes #7640 Conflicts: pom.xml
- Update pom to 2.4.3 from 2.4.2 - Enable the CBOR data header (aka tag) from the CBOR Generator to provide binary identification like the Smile format - Check for the CBOR header and ensure that the data sent in represents a "major type" that is an object - Cleans up `JsonVsCborTests` unused imports Closes #7640 Conflicts: pom.xml
This was reverted because the JSON tokenizer was acting up in some of the randomized tests. I am looking at the root cause (my change or just incoming changes from 2.4.3). |
CBOR has a special header that is optional, if exists, allows for exact detection. Also, since we know which formats we support in ES, we can support the object major type case. closes elastic#7640
CBOR has a special header that is optional, if exists, allows for exact detection. Also, since we know which formats we support in ES, we can support the object major type case. closes #7640
- Update pom to 2.4.3 from 2.4.2 - Enable the CBOR data header (aka tag) from the CBOR Generator to provide binary identification like the Smile format - Check for the CBOR header and ensure that the data sent in represents a "major type" that is an object - Cleans up `JsonVsCborTests` unused imports Closes elastic#7640 Conflicts: pom.xml
- Update pom to 2.4.3 from 2.4.2 - Enable the CBOR data header (aka tag) from the CBOR Generator to provide binary identification like the Smile format - Check for the CBOR header and ensure that the data sent in represents a "major type" that is an object - Cleans up `JsonVsCborTests` unused imports Closes elastic#7640 Conflicts: pom.xml
@clintongormley it'd be great to have this feature. What are the chances this will get into an upcoming release of Elasticsearch? |
@johnrfrank this was merged into 2.0.0. We've since deprecated content detection in favor of providing a content-type header. |
Currently we only check if the first byte of the body is a
BYTE_OBJECT_INDEFINITE
to determine whether the content is CBOR or not. However, what we should actually do is to check whether the "major type" is an object.See:
Also, CBOR can be prefixed with a self-identifying tag,
0xd9d9f7
, which we should check for as well. Currently Jackson doesn't recognise this tag, but it looks like that will change in the future: https://github.com/FasterXML/jackson-dataformat-cbor/issues/6The text was updated successfully, but these errors were encountered: