pedropaf / saas-ecom

Subscription support for ASP.NET MVC 5 apps using Stripe, including out-of-the-box view helpers. Available via NuGET
http://www.saasecom.org
Apache License 2.0
101 stars 41 forks source link

GetCountryFromIP fails when running locally #7

Closed benfoster closed 9 years ago

benfoster commented 9 years ago

If you're running locally and using IPv6 then the call to GeoLocation.GetCountryFromIP will fail since the IP will be an empty string.

I changed this to:

IPAddressCountry = string.IsNullOrEmpty(userIP) ? null : GeoLocationHelper.GetCountryFromIP(userIP),

To get everything running locally.

Note that this was for the MyNotes example.

pedropaf commented 9 years ago

Thanks @benfoster I have checked this in too.