Skip to content

Commit

Permalink
allow all cors
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgatis committed Apr 29, 2022
1 parent 2473aa7 commit f339a11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rembg/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import uvicorn
from asyncer import asyncify
from fastapi import Depends, FastAPI, File, Query
from fastapi.middleware.cors import CORSMiddleware
from starlette.responses import Response
from tqdm import tqdm
from watchdog.events import FileSystemEvent, FileSystemEventHandler
Expand Down Expand Up @@ -270,6 +271,14 @@ def s(port: int, log_level: str) -> None:
openapi_tags=tags_metadata,
)

app.add_middleware(
CORSMiddleware,
allow_credentials=True,
allow_origins=["*"],
allow_methods=["*"],
allow_headers=["*"],
)

class ModelType(str, Enum):
u2net = "u2net"
u2netp = "u2netp"
Expand Down

0 comments on commit f339a11

Please sign in to comment.