aio-libs / aio-libs/aiohttp-cors
get APP_CONFIG_KEY from parent app
Ouverte
- Langage dominant
- Python
- Étoiles
- 220
- Forks
- 61
- Merge moyen
- 2 min
- PR mergées (30 j)
- 3
Description
Hello,
if we use init CORS in main app not work in subapp
```Traceback (most recent call last):
File aiohttp_cors/mixin.py", line 22, in get_request_config
cors = request.app[APP_CONFIG_KEY]
File aiohttp/web_app.py", line 104, in __getitem__
return self._state[key]
KeyError: 'aiohttp_cors'
```
fix problem use config_dict https://docs.aiohttp.org/en/stable/web_reference.html#aiohttp.web.Request.config_dict
`cors = request.config_dict[APP_CONFIG_KEY]`
thanks!
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.