Skip to content

Commit

Permalink
Log new headers (#37528)
Browse files Browse the repository at this point in the history
* Log new headers

* update
  • Loading branch information
xiangyan99 authored Sep 24, 2024
1 parent f7930c8 commit 1b66229
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"conda/conda-releaselogs/azure-mgmt.md"
],
"words": [
"msedge",
"spinup",
"cibuildwheel",
"aoai",
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/azure-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/azure-core/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1b66229

Please sign in to comment.