Skip to content

Incompatible with CORSMiddleware app #4031

@wu-clan

Description

@wu-clan

Describe your environment

OS: any
Python version: any
Package version: 0.60b0

What happened?

fastapi/fastapi#8027

Steps to Reproduce

from typing import Optional
from starlette.middleware.cors import CORSMiddleware
from fastapi import FastAPI


fastapi_app = FastAPI()
app = CORSMiddleware(app=fastapi_app, allow_origins=['*'])
FastAPIInstrumentor.instrument_app(app)

Expected Result

Compatible with CORSMiddleware app.

Actual Result

Skipping FastAPI instrumentation due ... got CORSMiddleware.

Additional context

No response

Would you like to implement a fix?

None

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions