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

No longer accept invalid IP addresses in core's get_client_ip #4597

Merged
merged 1 commit into from
Aug 6, 2019

Conversation

NyanKiyoshi
Copy link
Member

@NyanKiyoshi NyanKiyoshi commented Aug 5, 2019

Closes #4595.

This fixes the error ValueError: 'Oopsie?' does not appear to be an IPv4 or IPv6 address when trying to get the user's country.

Screenshots

Pull Request Checklist

  1. Privileged views and APIs are guarded by proper permission checks.
  2. All visible strings are translated with proper context.
  3. All data-formatting is locale-aware (dates, numbers, and so on).
  4. Database queries are optimized and the number of queries is constant.
  5. Database migration files are up to date.
  6. The changes are tested.
  7. The code is documented (docstrings, project documentation).
  8. GraphQL schema and type definitions are up to date.
  9. Changes are mentioned in the changelog.

Copy link

django-queries commented Aug 5, 2019

Here is the report for a8ab73b (NyanKiyoshi/saleor @ core/ip/check-if-valid)
Base comparison is 3a50f4e.

No differences were found. (click me)

# api.benchmark checkout
  test name                           	left count 	right count	duplicate count
  ------------------------------------	-----------	-----------	---------------
  add billing address to checkout     	         34	         34	             20
  add shipping to checkout            	          7	          7	              0
  checkout payment charge             	         14	         14	              0
  complete checkout                   	          6	          6	              0
  create checkout                     	         48	         48	             24

# api.benchmark homepage
  test name                           	left count 	right count	duplicate count
  ------------------------------------	-----------	-----------	---------------
  retrieve main menu                  	          5	          5	              0
  retrieve product list               	          4	          4	              0
  retrieve secondary menu             	          5	          5	              0
  retrieve shop                       	          2	          2	              0

# api.benchmark product
  test name                           	left count 	right count	duplicate count
  ------------------------------------	-----------	-----------	---------------
  product details                     	         13	         13	              3

# api.benchmark variant
  test name                           	left count 	right count	duplicate count
  ------------------------------------	-----------	-----------	---------------
  retrieve variant list               	          9	          9	              2

@codecov
Copy link

codecov bot commented Aug 5, 2019

Codecov Report

Merging #4597 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4597      +/-   ##
=========================================
+ Coverage   90.89%   90.9%   +<.01%     
=========================================
  Files         296     296              
  Lines       17462   17477      +15     
  Branches     1738    1739       +1     
=========================================
+ Hits        15872   15887      +15     
  Misses       1086    1086              
  Partials      504     504
Impacted Files Coverage Δ
saleor/core/utils/__init__.py 80.68% <100%> (+2.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a50f4e...a8ab73b. Read the comment docs.

@maarcingebala maarcingebala merged commit a70939d into saleor:master Aug 6, 2019
@NyanKiyoshi NyanKiyoshi deleted the core/ip/check-if-valid branch August 6, 2019 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Which IP to retrieve from the environment variables
4 participants