fix handling of JSON string in a header field