Comments (9)
@wumpus sorry.
Please ping me in, say, 10 days.
Ok?
I have no free time to work on the issue personally now (review only maybe) but really want to get CORS plugin working.
Last months worked hard on CPython, added several important changes to asyncio. Have to finish this job before returning back to aio-libs projects.
from aiohttp-cors.
If you provide a patch I'm happy to review it.
from aiohttp-cors.
I suspect it's a bug that aiohttp-cors works great for GET and throws a configuration error for method '*'.
I don't see any tests for method '*' actually working. There are tests in tests/unit/test_cors_config related to webviews and mixins. That appears to be the only tests related to method '*'.
aiohttp-graphl is an example of middleware that expects method='*' to work
from aiohttp-cors.
Ping.
I think the basic issue is:
- CORS preflight request is a OPTIONS
- Lazy coders create routes to method='*' in middleware like aiohttp-graphl
- aiohttp-cors treats method='*' specially because it includes OPTIONS
- it would be nice if the middleware still worked
from aiohttp-cors.
Hi, @asvetlov !
I encountered the same error. Are there any solutions?
from aiohttp-cors.
Same problem here
from aiohttp-cors.
@andrii-maksymov and @jogc what middleware are you using?
from aiohttp-cors.
this is what i do, there is no other middleware used
aiohttp_jinja2.setup(app,
loader = jinja2.FileSystemLoader(os.path.dirname(os.path.abspath(__file__)) + '/templates'),
extensions = [ 'pypugjs.ext.jinja.PyPugJSExtension' ])
aiohttp_graphql.GraphQLView.attach(app, schema = schema,
graphiql = True)
cors = aiohttp_cors.setup(app, defaults={
'http://127.0.0.1:3000': aiohttp_cors.ResourceOptions(
allow_credentials=True,
expose_headers='*',
allow_headers=('Content-Type',),
)
})
from aiohttp-cors.
Thanks @jogc so you're using exactly the same middleware that I am.
Here is my patch that works around the problem in aiohttp_graphql, by handling every method other than OPTIONS:
graphql-python/aiohttp-graphql@master...wumpus:master
from aiohttp-cors.
Related Issues (20)
- Wildcard ports for localhost HOT 5
- What is the best way to grant CORS for all subdomains dynamically? HOT 6
- Cors and IOS Safari HOT 3
- Only 1 is allowed HOT 1
- thx for password and key to pypi HOT 1
- Python 3.8 test_static_resource failure: TypeError: issubclass() arg 1 must be a class
- DeprecationWarnings with Python 3.8: "@coroutine" decorator
- cant import aiohttp_cors HOT 1
- python3.7 HOT 3
- Does this project follow semver? HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Routing hierarchy confusion with CORs
- Should aiohttp-cors add a Vary: Origin when emitting a access-control-allow-origin? HOT 1
- 0.7.0 + master: pytest is failing HOT 2
- Is it possible to return `Access-Control-Allow-Origin: *` in response to preflight request instead of existing `Origin` header?
- Regex domains
- Lets through Postman / Curl requests HOT 2
- Let's put `aiohttp-cors` under the `aio-libs` org on PyPI
- How can I enforce CORS despite middlewares?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp-cors.