merchii/rack-iframe — pull request #1 by javiertoledo (2012-05-20 20:06:39+00:00)
Title: Fix for requests that doesn't contain an HTTP_USER_AGENT

Hi, this issue was driving me mad until I discovered rack-iframe was the source of the problem:
http://stackoverflow.com/questions/10675847/paypal-ipn-503-error-with-rails-3-0-10-and-heroku

It seems some APIs like Paypal IPN send back POST requests to the application which doesn't contain an HTTP_USER_AGENT, causing this gem to crash because of user_agent(env) returning nil. I've added a few chars to your code to avoid this issue and everything is working now.

I just wanted to share with you as I think it could be useful for more people and for more situations.