Closed casey closed 4 years ago
This is something that's changing between RFC 7049 and CBORbis, where the new version defines two possible key orderings for individual protocols to pick between. We're using the newer one, that doesn't mix values of different major types. We're still compatible with RFC 7049, which says "Those protocols are free to define what they mean by a canonical format and what encoders and decoders are expected to do."
Ah, gotcha, thank you for the clarification!
This just bit me in the as. I tried using a cbor package that didn't sort the keys in my headers maps. Can this be loosen up a bit?
at the moment i get ERR_INVALID_WEB_BUNDLE if i do not sort them myself according to this logic.
I was just reading through the Signed HTTP Exchanges draft, and I think the given example for how keys in a CBOR map should be sorted is incorrect.
The example reads:
However, section 3.9 of RFC 7049 states:
It's a little odd, but this reads to me as if keys should be sorted by key length first, and only then should keys with the same length be lexically sorted. This would give the sorting: