Skip to content

Commit 3c87ba9

Browse files
committed
Allow more http response headers
1 parent e60467c commit 3c87ba9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

msal/throttled_http_client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ def __init__(self, raw_response):
5353
super().__init__()
5454
self.status_code = raw_response.status_code
5555
self.text = raw_response.text
56-
self.headers = { # Only keep the headers which ThrottledHttpClient cares about
57-
k: v for k, v in _get_headers(raw_response).items()
58-
if k.lower() == RetryAfterParser.FIELD_NAME_LOWER
56+
self.headers = {
57+
k.lower(): v for k, v in _get_headers(raw_response).items()
58+
# Attempted storing only a small set of headers (such as Retry-After),
59+
# but it tends to lead to missing information (such as WWW-Authenticate).
60+
# So we store all headers, which are expected to contain only public info,
61+
# because we throttle only error responses and public responses.
5962
}
6063

6164
## Note: Don't use the following line,

0 commit comments

Comments
 (0)