Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

CORS not working #70

Open
mausamadh opened this issue Sep 21, 2021 · 2 comments
Open

CORS not working #70

mausamadh opened this issue Sep 21, 2021 · 2 comments

Comments

@mausamadh
Copy link

https://sanicframework.org/en/guide/how-to/cors.html#options.py

    for route in routes.values():
            for uri, methods in route.methods.items(): 
                if "OPTIONS" not in methods:
                    needs_options[uri].extend(methods)

getting error in the second loop, it says frozenset has no attribute items.

@sjsadowski
Copy link
Contributor

change

for uri, methods in route.methods.items():

to

for uri, methods in route.methods:

@ahopkins
Copy link
Member

I don't think that is a tuple that can be deconstructed. You'd have to use route.uri. I'll post a fix tomorrow.

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

No branches or pull requests

3 participants