Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions o365_api/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ async def run(self, loop):
"""

self.loop = loop
async with aiohttp.ClientSession(loop=loop) as session:
async with aiohttp.ClientSession(loop=loop, trust_env=True) as session:
self.session = session
coroutine_ = self.o365_log_foreman()
await asyncio.gather(coroutine_, loop=self.loop)
Expand Down Expand Up @@ -408,7 +408,7 @@ async def _api_get(self, content_type="application/json", encoding=None, **kwarg

"""

async with self.session.get(ssl=False, **kwargs) as r:
async with self.session.get(ssl=True, timeout=600, **kwargs) as r:
if r.status != 200:
logging.error("{}, {}, {}".format(r.url, r.status, r.reason))
raise ValueError(
Expand Down Expand Up @@ -504,7 +504,7 @@ async def _get_subscription_list(self):
""" Request a list of subscriptions from the API"""

http_args = {
"url": urljoin(self.root_api, "subscriptions/list"),
"url": urljoin(self.root_api, "feed/subscriptions/list"),
"headers": {"Authorization": self.token.return_authorization_string()},
"params": {"PublisherIdentifier": self.pub_id},
}
Expand Down Expand Up @@ -685,7 +685,7 @@ def _start_subscription_args(self, content_type):
""" Setup args for the API call to start subscriptions """

http_args = {
"url": urljoin(self.root_api, "subscriptions/start"),
"url": urljoin(self.root_api, "feed/subscriptions/start"),
"headers": {
"Authorization": self.token.return_authorization_string(),
"Content-Type": "application/json",
Expand Down Expand Up @@ -861,7 +861,7 @@ def _location_args(self, type_, window=None, endpoint=None):
# If not a pagination request, you'll need parameters
if not endpoint:
http_args = {
"url": urljoin(self.root_api, "subscriptions/content"),
"url": urljoin(self.root_api, "feed/subscriptions/content"),
"headers": {"Authorization": self.token.return_authorization_string()},
"params": {
"PublisherIdentifier": self.pub_id,
Expand Down