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

issues/88: create middleware that adds the real client IP address #187

Merged
merged 58 commits into from
Dec 11, 2022

Conversation

komuw
Copy link
Owner

@komuw komuw commented Dec 8, 2022

What:

  • Create middleware that adds the real client IP address
    Note that this is on a best effort basis. Finding the true client IP address is a precarious process[1]

Why:

Ref:

  1. https://adam-p.ca/blog/2022/03/x-forwarded-for/

@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2022

Codecov Report

Base: 72.25% // Head: 72.52% // Increases project coverage by +0.27% 🎉

Coverage data is based on head (4509790) compared to base (c9fdb51).
Patch coverage: 80.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
+ Coverage   72.25%   72.52%   +0.27%     
==========================================
  Files          31       33       +2     
  Lines        2076     2224     +148     
==========================================
+ Hits         1500     1613     +113     
- Misses        506      531      +25     
- Partials       70       80      +10     
Impacted Files Coverage Δ
middleware/csrf.go 100.00% <ø> (ø)
server/server.go 45.56% <ø> (ø)
sess/sess.go 83.33% <ø> (ø)
internal/clientip/client_ip.go 70.67% <70.67%> (ø)
cookie/cookie.go 79.81% <100.00%> (+3.66%) ⬆️
middleware/client_ip.go 100.00% <100.00%> (ø)
middleware/log.go 79.12% <100.00%> (-0.67%) ⬇️
middleware/middleware.go 100.00% <100.00%> (ø)
middleware/panic.go 93.33% <100.00%> (-0.61%) ⬇️
middleware/ratelimiter.go 95.58% <100.00%> (-0.13%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

cookie/cookie.go Outdated Show resolved Hide resolved
cookie/cookie.go Outdated Show resolved Hide resolved
@komuw komuw merged commit 2bd9f43 into main Dec 11, 2022
@komuw komuw deleted the issues/88 branch December 11, 2022 17:44
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.

taken account of X-Forwarded-For header
2 participants