Skip to content

Commit

Permalink
Merge pull request #258 from andrewwhitehead/fix/no-cookies
Browse files Browse the repository at this point in the history
Disable cookies on outbound requests
  • Loading branch information
nrempel authored Nov 8, 2019
2 parents ca0e463 + 250aace commit e34b277
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion aries_cloudagent/admin/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Coroutine, Sequence, Set
import uuid

from aiohttp import web, ClientSession
from aiohttp import web, ClientSession, DummyCookieJar
from aiohttp_apispec import docs, response_schema, setup_aiohttp_apispec
import aiohttp_cors

Expand Down Expand Up @@ -382,6 +382,7 @@ async def _process_webhooks(self):
collector: Collector = await self.context.inject(Collector, required=False)
if collector:
session_args["trace_configs"] = [StatsTracer(collector, "webhook-http:")]
session_args["cookie_jar"] = DummyCookieJar()
self.webhook_session = ClientSession(**session_args)
self.webhook_processor = TaskProcessor(max_pending=20)
async for topic, payload in self.webhook_queue:
Expand Down
3 changes: 2 additions & 1 deletion aries_cloudagent/transport/outbound/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging

from aiohttp import ClientSession
from aiohttp import ClientSession, DummyCookieJar

from ...messaging.outbound_message import OutboundMessage
from ..stats import StatsTracer
Expand All @@ -27,6 +27,7 @@ async def start(self):
session_args["trace_configs"] = [
StatsTracer(self.collector, "outbound-http:")
]
session_args["cookie_jar"] = DummyCookieJar()
self.client_session = ClientSession(**session_args)
return self

Expand Down
4 changes: 2 additions & 2 deletions aries_cloudagent/transport/outbound/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging

from aiohttp import ClientSession
from aiohttp import ClientSession, DummyCookieJar

from ...messaging.outbound_message import OutboundMessage

Expand All @@ -21,7 +21,7 @@ def __init__(self) -> None:

async def start(self):
"""Start the outbound transport."""
self.client_session = ClientSession()
self.client_session = ClientSession(cookie_jar=DummyCookieJar())
return self

async def stop(self):
Expand Down

0 comments on commit e34b277

Please sign in to comment.