Rack:Request is not the same as ActionDispatch::Request
jpmckinney opened this issue · 1 comments
jpmckinney commented
Notably, they handle attachments differently. I set up two servers for Mailgun to POST to. Here are the results:
- request.params in a basic Rack app
- params in a basic Rails app
You'll notice that in the pure Rack environment, attachment-1
is a hash. In Rails, it's an ActionDispatch::Http::UploadedFile
object. Your code assumes you are passing a ActionDispatch::Http::UploadedFile
object to the Mailgun receiver.
I just ran into this in my own project MultiMail. I handle both cases now by checking if attachment-1
is a hash.
joshuap commented
Awesome, thanks for the report. If you have time we'd love a pull request, otherwise I'll add this one to my own todo list. 👍