Skip to content

get APP_CONFIG_KEY from parent app  #219

Description

@afanasevps

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions