BUG: Content length was wrong after json compaction.

Check in on behalf of Robert