Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,14 @@ app.add_middleware(
|
|
15 |
allow_headers=["*"],
|
16 |
)
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
class Box:
|
19 |
def __init__(self, length, width, height, quantity, box_type):
|
20 |
self.length = length
|
|
|
15 |
allow_headers=["*"],
|
16 |
)
|
17 |
|
18 |
+
@app.options("/{rest_of_path:path}")
|
19 |
+
async def preflight_handler(request: Request, rest_of_path: str) -> Response:
|
20 |
+
return Response(headers={
|
21 |
+
"Access-Control-Allow-Origin": "*", # Allows all origins
|
22 |
+
"Access-Control-Allow-Methods": "POST, GET, OPTIONS, PUT, DELETE", # Specify methods allowed
|
23 |
+
"Access-Control-Allow-Headers": "*", # Allows all headers
|
24 |
+
})
|
25 |
+
|
26 |
class Box:
|
27 |
def __init__(self, length, width, height, quantity, box_type):
|
28 |
self.length = length
|