Fix for requests that doesn't contain an HTTP_USER_AGENT #1

Merged
merged 1 commit into from May 21, 2012

Conversation

Projects
None yet
2 participants
Contributor

javiertoledo commented May 20, 2012

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.

@javiertoledo javiertoledo Fix for requests that doesn't contain an HTTP_USER_AGENT
Some APIs like Paypal IPN send back POST requests to your application which doesn't contain an HTTP_USER_AGENT, causing this gem to crash. This little fix avoids this issue.
65209b1

@grimen grimen added a commit that referenced this pull request May 21, 2012

@grimen grimen Merge pull request #1 from javiertoledo/master
Fix for requests that doesn't contain an HTTP_USER_AGENT
91c6e94

@grimen grimen merged commit 91c6e94 into grimen:master May 21, 2012

Owner

grimen commented May 21, 2012

Thanks Javier!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment