mirror of https://github.com/tiangolo/fastapi.git
remove allow_credentials
This commit is contained in:
parent
cbbaeff4f9
commit
b58ed871d3
|
|
@ -13,9 +13,8 @@ origins = [
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origins=origins,
|
allow_origins=origins,
|
||||||
allow_credentials=True,
|
allow_methods=["*"],
|
||||||
allow_methods=["GET"],
|
allow_headers=["*"],
|
||||||
allow_headers=["Authorization", "X-Example"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,7 @@ def test_cors():
|
||||||
response.headers["access-control-allow-origin"]
|
response.headers["access-control-allow-origin"]
|
||||||
== "https://localhost.tiangolo.com"
|
== "https://localhost.tiangolo.com"
|
||||||
)
|
)
|
||||||
assert response.headers["access-control-allow-headers"] == (
|
assert response.headers["access-control-allow-headers"] == "X-Example"
|
||||||
"Accept, Accept-Language, "
|
|
||||||
"Authorization, Content-Language, "
|
|
||||||
"Content-Type, X-Example"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Test standard response
|
# Test standard response
|
||||||
headers = {"Origin": "https://localhost.tiangolo.com"}
|
headers = {"Origin": "https://localhost.tiangolo.com"}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue