aiohttp-cors
aiohttp-cors copied to clipboard
`aiohttp-cors` accesses the aiohttp protected `self._routes`
https://github.com/aio-libs/aiohttp-cors/blob/38c6c17bffc805e46baccd7be1b4fd8c69d95dc3/aiohttp_cors/urldispatcher_router_adapter.py#L187
> `aiohttp-cors` accesses the protected `self._routes` here and relies on being able to add new methods
We could just update that library?
Originally posted by @Dreamsorcerer in https://github.com/aio-libs/aiohttp/issues/9972#issuecomment-2500938152
We may need to expose a public method in aiohttp for this so this library doesn't need to access the protected one
Good finding!
IIRC a resource can iterate over routes; it works but could be inefficient for the library.
Adding resource.routes property that returns a read-only mapping looks like a reasonable addition to me.