Skip to content

Commit 7452d0e

Browse files
committed
feat: Add options response for DIDComm Demo
Signed-off-by: Colton Wolkins (Laptop) <[email protected]>
1 parent 02818e3 commit 7452d0e

File tree

1 file changed

+20
-0
lines changed
  • acapy_agent/transport/inbound

1 file changed

+20
-0
lines changed

acapy_agent/transport/inbound/http.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ async def make_application(self) -> web.Application:
3838
app = web.Application(**app_args)
3939
app.add_routes([web.get("/", self.invite_message_handler)])
4040
app.add_routes([web.post("/", self.inbound_message_handler)])
41+
app.add_routes([web.options("/", self.options_message_handler)])
4142
return app
4243

4344
async def start(self) -> None:
@@ -128,6 +129,25 @@ async def inbound_message_handler(self, request: web.BaseRequest):
128129
)
129130
return web.Response(status=200)
130131

132+
async def options_message_handler(self, request: web.BaseRequest):
133+
"""Message handler for invites.
134+
135+
Args:
136+
request: aiohttp request object
137+
138+
Returns:
139+
The web response
140+
141+
"""
142+
return web.Response(
143+
status=200,
144+
headers={
145+
"Access-Control-Allow-Headers": "Content-Type",
146+
"Access-Control-Allow-Origin": "*",
147+
"Access-Control-Allow-Methods": "GET,POST",
148+
},
149+
)
150+
131151
async def invite_message_handler(self, request: web.BaseRequest):
132152
"""Message handler for invites.
133153

0 commit comments

Comments
 (0)