Skip to content

Commit

Permalink
Merge pull request venth#410 from venth/fix/drop_user_agent
Browse files Browse the repository at this point in the history
fix: drop user-agent header from requests as it only seems to cause issues, especially with Duo
  • Loading branch information
pdecat authored Sep 14, 2023
2 parents e275453 + 5cb82c4 commit bac75ba
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions aws_adfs/_duo_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

_headers = {
'Accept-Language': 'en',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': 'text/plain, */*; q=0.01',
}
Expand Down Expand Up @@ -418,7 +417,6 @@ def _initiate_authentication(duo_host, duo_request_signature, roles_page_url, se
verify=ssl_verification_enabled,
headers={
'Host': duo_host,
'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
'Accept-Language': "en-US,en;q=0.5",
'Accept-Encoding': "gzip, deflate, br",
Expand Down
3 changes: 0 additions & 3 deletions aws_adfs/_duo_universal_prompt_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@

_headers = {
"Accept-Language": "en",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) like Gecko"
if platform.system() in ("Linux", "Darwin")
else "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"Accept": "text/plain, */*; q=0.01",
}
Expand Down
1 change: 0 additions & 1 deletion aws_adfs/account_aliases_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def account_aliases(session, username, password, auth_method, saml_response, con
verify=config.ssl_verification,
headers={
'Accept-Language': 'en',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': 'text/plain, */*; q=0.01',
},
Expand Down

0 comments on commit bac75ba

Please sign in to comment.