Skip to content

Commit f2974c1

Browse files
Fixes #222
Account for aiohttp use of yarl.URL class instead of base str class prior to checking base domain.
1 parent cd3d24f commit f2974c1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

meraki/aio/rest_session.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ async def _request(self, metadata, method, url, **kwargs):
149149

150150
# Ensure proper base URL
151151
allowed_domains = ['meraki.com', 'meraki.cn']
152+
153+
# aiohttp manipulates URLs as instances of the yarl.URL class
154+
if not isinstance(url, str):
155+
url = str(url)
156+
152157
parsed_url = urllib.parse.urlparse(url)
153158

154159
if any(domain in parsed_url.netloc for domain in allowed_domains):

0 commit comments

Comments
 (0)