Spaces:
Sleeping
Sleeping
Commit ·
a3c4cc9
1
Parent(s): f183aea
feat(app): add CORS middleware — allow all origins for Spaces compatibility
Browse files- server/app.py +9 -0
server/app.py
CHANGED
|
@@ -1,7 +1,16 @@
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI(
|
| 4 |
title = "RedTeamOS",
|
| 5 |
description = "AI Red-Teaming Environment for Safety Research",
|
| 6 |
version = "0.1.0",
|
| 7 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
|
| 4 |
app = FastAPI(
|
| 5 |
title = "RedTeamOS",
|
| 6 |
description = "AI Red-Teaming Environment for Safety Research",
|
| 7 |
version = "0.1.0",
|
| 8 |
)
|
| 9 |
+
|
| 10 |
+
app.add_middleware(
|
| 11 |
+
CORSMiddleware,
|
| 12 |
+
allow_origins = ["*"],
|
| 13 |
+
allow_credentials = True,
|
| 14 |
+
allow_methods = ["*"],
|
| 15 |
+
allow_headers = ["*"],
|
| 16 |
+
)
|