paveltyk / sendgrid-rails

SendGrid extensions to Rails 3 ActionMailer::Base
http://paveltyk.github.com/sendgrid-rails/
73 stars 23 forks source link

Fold long smtp api header #8

Closed gtd closed 12 years ago

gtd commented 12 years ago

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.

paveltyk commented 12 years ago

Thank you for help. Released v2.0.2 with fix for that issue.