From 1b6622904fb80082c7ca130e7d21962744ee9631 Mon Sep 17 00:00:00 2001 From: Xiang Yan Date: Tue, 24 Sep 2024 06:48:13 -0700 Subject: [PATCH] Log new headers (#37528) * Log new headers * update --- .vscode/cspell.json | 1 + sdk/core/azure-core/CHANGELOG.md | 2 ++ sdk/core/azure-core/azure/core/pipeline/policies/_universal.py | 2 ++ sdk/core/azure-core/tests/test_pipeline.py | 2 ++ 4 files changed, 7 insertions(+) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 628b0a8ee30a..9f86abddb3da 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -138,6 +138,7 @@ "conda/conda-releaselogs/azure-mgmt.md" ], "words": [ + "msedge", "spinup", "cibuildwheel", "aoai", diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 3b6f173fefdd..2abf318002b8 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- Log "x-vss-e2eid" and "x-msedge-ref" headers in `HttpLoggingPolicy`. + ## 1.31.0 (2024-09-12) ### Features Added diff --git a/sdk/core/azure-core/azure/core/pipeline/policies/_universal.py b/sdk/core/azure-core/azure/core/pipeline/policies/_universal.py index 4fca7e0996eb..72548aee396b 100644 --- a/sdk/core/azure-core/azure/core/pipeline/policies/_universal.py +++ b/sdk/core/azure-core/azure/core/pipeline/policies/_universal.py @@ -417,6 +417,8 @@ class HttpLoggingPolicy( "Transfer-Encoding", "User-Agent", "WWW-Authenticate", # OAuth Challenge header. + "x-vss-e2eid", # Needed by Azure DevOps pipelines. + "x-msedge-ref", # Needed by Azure DevOps pipelines. ] ) REDACTED_PLACEHOLDER: str = "REDACTED" diff --git a/sdk/core/azure-core/tests/test_pipeline.py b/sdk/core/azure-core/tests/test_pipeline.py index e3ad77bb02dc..89ca3b5a5599 100644 --- a/sdk/core/azure-core/tests/test_pipeline.py +++ b/sdk/core/azure-core/tests/test_pipeline.py @@ -70,6 +70,8 @@ def test_default_http_logging_policy(http_request): assert http_logging_policy.allowed_header_names == HttpLoggingPolicy.DEFAULT_HEADERS_WHITELIST assert http_logging_policy.allowed_header_names == HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST assert "WWW-Authenticate" in http_logging_policy.allowed_header_names + assert "x-vss-e2eid" in http_logging_policy.allowed_header_names + assert "x-msedge-ref" in http_logging_policy.allowed_header_names # Testing I can replace the set entirely HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST = set(HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST) HttpLoggingPolicy.DEFAULT_HEADERS_WHITELIST = set(HttpLoggingPolicy.DEFAULT_HEADERS_ALLOWLIST)