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

Update ip algorithm #237

Merged
merged 3 commits into from
Apr 6, 2023
Merged

Update ip algorithm #237

merged 3 commits into from
Apr 6, 2023

Conversation

estringana
Copy link
Collaborator

@estringana estringana commented Apr 5, 2023

Description

Update ip detection algorithm to pick the most priority header. Before if there were ips in multiple headers, it would report all of them

Motivation

Additional Notes

Describe how to test your changes

Readiness checklist

  • Unit tests have been updated and pass
  • If known, an appropriate milestone has been selected
  • All new source files include the required notice

Release checklist

  • The CHANGELOG.md has been updated

@estringana estringana force-pushed the estringana/update-ip-extraction branch from 672f91c to d914793 Compare April 5, 2023 15:39
@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2023

Codecov Report

Merging #237 (92084c6) into master (403dd11) will increase coverage by 7.32%.
The diff coverage is 91.42%.

@@            Coverage Diff             @@
##           master     #237      +/-   ##
==========================================
+ Coverage   63.87%   71.19%   +7.32%     
==========================================
  Files          88       25      -63     
  Lines        5655     3222    -2433     
  Branches     1794      716    -1078     
==========================================
- Hits         3612     2294    -1318     
+ Misses        972      553     -419     
+ Partials     1071      375     -696     
Flag Coverage Δ
extension 71.19% <91.42%> (-0.26%) ⬇️
helper ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/extension/ip_extraction.c 86.85% <90.90%> (-1.45%) ⬇️
src/extension/tags.c 83.94% <100.00%> (+0.50%) ⬆️

... and 64 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@estringana estringana force-pushed the estringana/update-ip-extraction branch from d914793 to 66f4449 Compare April 6, 2023 09:34
@estringana estringana marked this pull request as ready for review April 6, 2023 09:35
@estringana estringana requested a review from Anilm3 April 6, 2023 09:35
@estringana
Copy link
Collaborator Author

I will update the trace algorithm when this gets merged @Anilm3

Copy link
Collaborator

@Anilm3 Anilm3 left a comment

Choose a reason for hiding this comment

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

Looks good although perhaps a few more parsing tests for the new headers would be useful.

test('via', '2001:abcf:1f::55');

test('true_client_ip', '8.8.8.8');
test('fastly_client_ip', '7.7.7.2');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps a few more tests with valid / invalid IPs as wells as IPv4 and IPv6 and ports. For all three new headers...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fair enough

@estringana estringana merged commit b6a9ba0 into master Apr 6, 2023
28 checks passed
@estringana estringana deleted the estringana/update-ip-extraction branch April 6, 2023 15:10
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.

None yet

3 participants