Skip to content

Commit

Permalink
fix(user-agent) Update ua to prevent lockout #70
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian authored Nov 4, 2022
1 parent e65fc02 commit 2a021ee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion connectedcar/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, access_token, region, locale = 'en-US'):
'auth-token': access_token,
'Accept': '*/*',
'Accept-Language': 'en-US',
'User-Agent': 'FordPass/5 CFNetwork/1333.0.4 Darwin/21.5.0',
'User-Agent': 'FordPass/24 CFNetwork/1399 Darwin/22.1.0',
'Content-Type': 'application/json',
'Accept-Encoding': 'gzip, deflate, br',
'Application-Id': regions[region],
Expand Down
4 changes: 2 additions & 2 deletions connectedcar/connectedcar.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AuthClient(object):
defaultHeaders = {
"Accept": "*/*",
"Accept-Language": "en-us",
"User-Agent": "FordPass/5 CFNetwork/1197 Darwin/20.0.0",
"User-Agent": "FordPass/24 CFNetwork/1399 Darwin/22.1.0",
"Accept-Encoding": "gzip, deflate, br",
}

Expand Down Expand Up @@ -188,7 +188,7 @@ def exchange_refresh_token(self, refresh_token):
'Accept': '*/*',
'Accept-Language': 'en-US',
'Content-Type': 'application/json',
'User-Agent': 'FordPass/5 CFNetwork/1333.0.4 Darwin/21.5.0',
'User-Agent': 'FordPass/24 CFNetwork/1399 Darwin/22.1.0',
'Accept-Encoding': 'gzip, deflate, br',
'Application-Id': self.region
}
Expand Down
2 changes: 1 addition & 1 deletion connectedcar/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def call(method, url, **kwargs):

if "headers" not in kwargs:
kwargs["headers"] = {}
kwargs['headers']['User-Agent'] = 'FordPass/5 CFNetwork/1327.0.4 Darwin/21.2.0'
kwargs['headers']['User-Agent'] = 'FordPass/24 CFNetwork/1399 Darwin/22.1.0'

try:
response = requests.request(method, url, timeout=310, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_user_agent(self):
connectedcar.requester.call('GET', self.URL)
self.assertEqual(
responses.calls[0].request.headers['User-Agent'],
'fordpass-na/353 CFNetwork/1121.2.2 Darwin/19.3.0',
'FordPass/24 CFNetwork/1399 Darwin/22.1.0',
)

@responses.activate
Expand Down

0 comments on commit 2a021ee

Please sign in to comment.