Skip to content

Mail#send_mail cannot handle a large multiline x-smtpapi header #13

Description

@RUN-CMD

SendgridToolkit::AbstractSendgridClient#api_post calls HTTParty.post using the options key "query" rather than "body".
When using the key "query", HTTParty appends the urlencoded options to the URI.

With a large x-smtpapi header (eg. sending to hundreds of recipients) via Mail#send_mail, this causes SendGrid's servers to return a "414 Request-URI Too Large" (they also incorrectly return the error as text/html rather than just headers :/ ).

Since SendgridToolkit sends all requests as POST, I think it'd be safe to always send the request parameters as the request body rather than in the query string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions