Skip to content

Commit 20b65d9

Browse files
committed
Enable http_client decoration
1 parent 87e8644 commit 20b65d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

msal/application.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from .token_cache import TokenCache
2121
import msal.telemetry
2222
from .region import _detect_region
23+
from .http_decorate import _decorate
2324

2425

2526
# The __init__.py will import this. Not the other way around.
@@ -295,6 +296,7 @@ def __init__(
295296
a = requests.adapters.HTTPAdapter(max_retries=1)
296297
self.http_client.mount("http://", a)
297298
self.http_client.mount("https://", a)
299+
_decorate(self.http_client, {}) # Hard code an in-memory cache, for now
298300

299301
self.app_name = app_name
300302
self.app_version = app_version
@@ -392,6 +394,7 @@ def _build_client(self, client_credential, authority, skip_regional_client=False
392394
"x-client-sku": "MSAL.Python", "x-client-ver": __version__,
393395
"x-client-os": sys.platform,
394396
"x-client-cpu": "x64" if sys.maxsize > 2 ** 32 else "x86",
397+
"x-ms-lib-capability": "retry-after, h429",
395398
}
396399
if self.app_name:
397400
default_headers['x-app-name'] = self.app_name

0 commit comments

Comments
 (0)