Closed babolivier closed 1 year ago
Add a simple aiohttp middleware that adds CORS headers to requests, and handle OPTIONS requests.
OPTIONS
I've also fixed the case of _MEDIA_PATH_REGEXP (since it's a constant) while I was there.
_MEDIA_PATH_REGEXP
Fixes #41
The list of headers is inspired from https://github.com/matrix-org/matrix-content-scanner/issues/28, except I've reduced the list of allowed methods to GET, POST, OPTIONS because we don't handle other ones.
GET, POST, OPTIONS
Add a simple aiohttp middleware that adds CORS headers to requests, and handle
OPTIONS
requests.I've also fixed the case of
_MEDIA_PATH_REGEXP
(since it's a constant) while I was there.Fixes #41
The list of headers is inspired from https://github.com/matrix-org/matrix-content-scanner/issues/28, except I've reduced the list of allowed methods to
GET, POST, OPTIONS
because we don't handle other ones.