Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid 500 server error with IPv6 addresses (GeoIP) #754

Merged
merged 1 commit into from Oct 28, 2014

Conversation

@zeehio
Copy link
Contributor

@zeehio zeehio commented Oct 17, 2014

I get 500 Server errors when searching for resources with a non-empty string.
With DEBUG=True I can get the exception: Invalid database type; expected IPv4 address which is backtraced to the getcountry_code function in the stats/geoip.py file.

The proposed try/except patch fixes the issue by returning the default empty string if geoip cannot find the country.

As far as I know, this is used for statistic purposes, so providing the country guessed by the IP it is not crucial for metashare.

I get 500 Server errors when searching for resources with a non-empty string.
With DEBUG=True I can get the exception: "Invalid database type; expected IPv4 address" which is backtraced to the getcountry_code function in the stats/geoip.py file.

The proposed try/except patch fixes the issue by returning the default empty string if geoip cannot find the country.

As far as I know, this is used for statistic purposes, so providing the country guessed by the IP it is not crucial for metashare.
jsteffen added a commit that referenced this pull request Oct 28, 2014
Avoid 500 server error with IPv6 addresses (GeoIP)
@jsteffen jsteffen merged commit 1512cfc into metashare:master Oct 28, 2014
@zeehio zeehio deleted the zeehio:patch-1 branch Mar 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants