Skip to content

chore(aap): use forwarded as IP pattern #14400

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ddtrace/contrib/internal/trace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"x-real-ip",
"true-client-ip",
"x-client-ip",
"forwarded",
"forwarded-for",
"x-cluster-client-ip",
"fastly-client-ip",
Expand Down
4 changes: 1 addition & 3 deletions tests/tracer/test_trace_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def test_set_http_meta_case_sensitive_headers_notfound(mock_store_headers, span,
("x-real-ip", "2.2.2.2"),
("true-client-ip", "3.3.3.3"),
("x-client-ip", "4.4.4.4"),
("x-forwarded", "5.5.5.5"),
("forwarded", "5.5.5.5"),
("forwarded-for", "6.6.6.6"),
("x-cluster-client-ip", "7.7.7.7"),
("fastly-client-ip", "8.8.8.8"),
Expand All @@ -644,8 +644,6 @@ def test_set_http_meta_case_sensitive_headers_notfound(mock_store_headers, span,
ALL_TESTS = [
["", dict(ALL_IP_HEADERS[-1 : -i - 2 : -1]), ALL_IP_HEADERS[-1 - i][1]] for i in range(len(ALL_IP_HEADERS))
]
# x-forwarded is now ignored so we fall back to forwarded-for
ALL_TESTS[5][2] = "6.6.6.6"


@pytest.mark.parametrize(
Expand Down
Loading