Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get APP_CONFIG_KEY from parent app #219

Open
afanasevps opened this issue Jan 17, 2019 · 4 comments
Open

get APP_CONFIG_KEY from parent app #219

afanasevps opened this issue Jan 17, 2019 · 4 comments

Comments

@afanasevps
Copy link

afanasevps commented Jan 17, 2019

Hello,
if we use init CORS in main app not work in subapp

  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!

@asvetlov
Copy link
Member

Hi!
Good catch!
Would you mind working on Pull Request?

@afanasevps
Copy link
Author

ok, sure i'll do PL

afanasevps pushed a commit to afanasevps/aiohttp-cors that referenced this issue Jan 18, 2019
@afanasevps
Copy link
Author

@asvetlov PL here - #220

@parikls
Copy link

parikls commented Jun 23, 2022

Can anyone approve PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants