File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ dependencies = [
2121 " stac-fastapi.types" ,
2222 " stac-pydantic==3.1.*" ,
2323 " brotli-asgi" ,
24- " starlette < 0.51.0 " ,
24+ " starlette" ,
2525 " typing_extensions" ,
2626 " shapely" ,
2727]
Original file line number Diff line number Diff line change 2929from fastapi .middleware import Middleware
3030from fastapi .responses import ORJSONResponse
3131from stac_fastapi .api .app import StacApi
32- from stac_fastapi .api .middleware import CORSMiddleware
3332from stac_fastapi .api .models import (
3433 EmptyRequest ,
3534 ItemCollectionUri ,
4847from stac_fastapi .extensions .core .pagination .token_pagination import TokenPaginationExtension
4948from stac_fastapi .extensions .core .query import QueryConformanceClasses
5049from stac_fastapi .extensions .core .sort import SortConformanceClasses
50+ from starlette .middleware .cors import CORSMiddleware
5151
5252from stac_fastapi .eodag .config import get_settings
5353from stac_fastapi .eodag .core import EodagCoreClient
@@ -225,7 +225,14 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
225225 items_get_request_model = item_collection_model ,
226226 middlewares = [
227227 Middleware (BrotliMiddleware ),
228- Middleware (CORSMiddleware ),
228+ Middleware (
229+ CORSMiddleware ,
230+ # Set CORS defaults to those recommended by the STAC API spec
231+ allow_origins = ["*" ],
232+ allow_methods = ["OPTIONS" , "POST" , "GET" ],
233+ allow_headers = ["Content-Type" ],
234+ max_age = 600 ,
235+ ),
229236 Middleware (ProxyHeaderMiddleware ),
230237 ],
231238)
You can’t perform that action at this time.
0 commit comments