From f3e1f7bb2d8425f98873b09fb0ca86c188082c31 Mon Sep 17 00:00:00 2001 From: Simone Del Zotto Date: Thu, 14 Mar 2024 12:15:08 +0100 Subject: [PATCH] Add User-Agent header to avoid 403 Forbidden error when downloading metadata from poste.it --- src/djangosaml2_spid/management/commands/update_idps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/djangosaml2_spid/management/commands/update_idps.py b/src/djangosaml2_spid/management/commands/update_idps.py index 8603223..96344ea 100644 --- a/src/djangosaml2_spid/management/commands/update_idps.py +++ b/src/djangosaml2_spid/management/commands/update_idps.py @@ -64,7 +64,7 @@ def download_identity_providers(self): indentation_level=1, ) - #Add User-Agent heder to avoid 403 Forbidden error when downloading metadata from poste.it + #Add User-Agent header to avoid 403 Forbidden error when downloading metadata from poste.it with requests.get(idp_metadata_url, verify=True, headers={'User-Agent': ''}) as response: identity_provider["metadata"] = response.text