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

Added new client_ip accessor #2114

Merged
merged 9 commits into from Jun 16, 2021
Merged

Added new client_ip accessor #2114

merged 9 commits into from Jun 16, 2021

Conversation

sjsadowski
Copy link
Contributor

Added new client_ip accessor for ConnInfo class, updated request to use client_ip instead of client to be more representative of what will be returned (actual ipv6 ip instead of bracket wrapped ip)

…se client_ip instead of client to be more representative of what will be returned (actual ipv6 ip instead of bracket wrapped ip)
@sjsadowski
Copy link
Contributor Author

This will close #1901 when merged

@sjsadowski sjsadowski linked an issue Apr 14, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #2114 (d874ecc) into main (1a352dd) will increase coverage by 0.018%.
The diff coverage is 81.633%.

❗ Current head d874ecc differs from pull request most recent head cab88ba. Consider uploading reports for the commit cab88ba to get more accurate results
Impacted file tree graph

@@              Coverage Diff              @@
##              main     #2114       +/-   ##
=============================================
+ Coverage   92.133%   92.151%   +0.018%     
=============================================
  Files           38        38               
  Lines         3470      3478        +8     
  Branches       572       575        +3     
=============================================
+ Hits          3197      3205        +8     
  Misses         185       185               
  Partials        88        88               
Impacted Files Coverage Δ
sanic/__main__.py 75.000% <33.333%> (ø)
sanic/server.py 88.235% <45.455%> (+0.060%) ⬆️
sanic/http.py 77.491% <75.000%> (ø)
sanic/app.py 92.623% <100.000%> (ø)
sanic/config.py 100.000% <100.000%> (ø)
sanic/errorpages.py 98.519% <100.000%> (ø)
sanic/handlers.py 95.455% <100.000%> (ø)
sanic/headers.py 100.000% <100.000%> (ø)
sanic/mixins/routes.py 93.401% <100.000%> (ø)
sanic/request.py 97.712% <100.000%> (ø)

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 aff6604...cab88ba. Read the comment docs.

@ahopkins
Copy link
Member

Nice. Some tests when you have a chance? 😎

@sjsadowski
Copy link
Contributor Author

@ahopkins that's why it's still a draft, need to make sure test_client will do what I want.

@ahopkins
Copy link
Member

😆 totally didn't see that. sorry. I was on my phone.

Might need to mock it. IIRC, I had some problems in the past. But, that might have been ASGI client.

Tronic
Tronic previously approved these changes Apr 15, 2021
Copy link
Member

@Tronic Tronic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Leaving discussion of other necessary work on bracket handling and client IPs elsewhere (I don't believe that socket level client IP is very useful; usually you want true remote IP instead).

@sjsadowski
Copy link
Contributor Author

Test client doesn't support ipv6, looks like. Going to have to come at the tests from a different direction... probably mocking like @ahopkins suggested.

@ahopkins
Copy link
Member

Test client doesn't support ipv6, looks like. Going to have to come at the tests from a different direction... probably mocking like @ahopkins suggested.

I'll spend some time looking at the test client tonight. It should be able to.

@ahopkins ahopkins marked this pull request as ready for review June 16, 2021 18:13
@ahopkins ahopkins requested review from a team as code owners June 16, 2021 18:13
@ahopkins ahopkins merged commit 83c746e into main Jun 16, 2021
@ahopkins ahopkins deleted the ipv6-address-fix branch June 16, 2021 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPV6 address wrapped in brackets
3 participants