Spaces:
Sleeping
Sleeping
Soham Banerjee commited on
Commit ·
54de384
1
Parent(s): 7bf9d4b
Add permissive trailing slashes for API endpoints
Browse files
__pycache__/app.cpython-314.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-314.pyc and b/__pycache__/app.cpython-314.pyc differ
|
|
|
__pycache__/content_moderation_env.cpython-314.pyc
CHANGED
|
Binary files a/__pycache__/content_moderation_env.cpython-314.pyc and b/__pycache__/content_moderation_env.cpython-314.pyc differ
|
|
|
server/app.py
CHANGED
|
@@ -445,6 +445,7 @@ import uvicorn
|
|
| 445 |
app = FastAPI()
|
| 446 |
|
| 447 |
@app.post("/reset")
|
|
|
|
| 448 |
async def api_reset(request: Request):
|
| 449 |
"""POST /reset → initial observation, HTTP 200"""
|
| 450 |
try:
|
|
@@ -462,6 +463,7 @@ async def api_reset(request: Request):
|
|
| 462 |
|
| 463 |
|
| 464 |
@app.post("/step")
|
|
|
|
| 465 |
async def api_step(request: Request):
|
| 466 |
"""POST /step → takes action dict, returns result"""
|
| 467 |
try:
|
|
@@ -477,6 +479,7 @@ async def api_step(request: Request):
|
|
| 477 |
|
| 478 |
|
| 479 |
@app.get("/state")
|
|
|
|
| 480 |
async def api_state():
|
| 481 |
"""GET /state → current environment state"""
|
| 482 |
try:
|
|
|
|
| 445 |
app = FastAPI()
|
| 446 |
|
| 447 |
@app.post("/reset")
|
| 448 |
+
@app.post("/reset/")
|
| 449 |
async def api_reset(request: Request):
|
| 450 |
"""POST /reset → initial observation, HTTP 200"""
|
| 451 |
try:
|
|
|
|
| 463 |
|
| 464 |
|
| 465 |
@app.post("/step")
|
| 466 |
+
@app.post("/step/")
|
| 467 |
async def api_step(request: Request):
|
| 468 |
"""POST /step → takes action dict, returns result"""
|
| 469 |
try:
|
|
|
|
| 479 |
|
| 480 |
|
| 481 |
@app.get("/state")
|
| 482 |
+
@app.get("/state/")
|
| 483 |
async def api_state():
|
| 484 |
"""GET /state → current environment state"""
|
| 485 |
try:
|