Browse Source

Corrected code include

pull/13536/head
Motov Yurii 1 month ago
committed by GitHub
parent
commit
147332ea2d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 20
      docs/fa/docs/tutorial/cors.md

20
docs/fa/docs/tutorial/cors.md

@ -57,25 +57,7 @@
- **متدهای HTTP خاص** (`POST`, `PUT`) یا تمام متدها با `"*"`
- **هدرهای HTTP خاص** یا همه‌ی آن‌ها با `"*"`
```python
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
"http://localhost:8080",
"https://example.com",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
```
{* ../../docs_src/cors/tutorial001.py hl[2,6:11,13:19] *}
---

Loading…
Cancel
Save