PavelTyk/sendgrid-rails — pull request #8 by dasil003 (2012-06-28 10:14:25+00:00)
Title: Fold long smtp api header

Here is a properly spec'ed and tested folded API header. I realize this implementation incurs a performance penalty by generating JSON twice for long headers, but this way tests don't break and short API headers remain as terse as possible.

The optimal solution would be to use a SAX style JSON parser on the original JSON string to insert spaces strategically, but I don't think that merits the inclusion of another dependency.