fix(api): fix trailing slash proxy redirects

This commit is contained in:
2026-04-02 20:50:55 +02:00
parent bd116ff247
commit 93f9e88fc4
3 changed files with 4 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ from dlib.auth import AuthenticatedUser
router = APIRouter(prefix="/documents", tags=["documents"])
@router.get("/", response_model=DocumentListResponse)
@router.get("", response_model=DocumentListResponse)
async def list_user_documents(
session: AsyncSession = Depends(get_db),
user: AuthenticatedUser = Depends(get_current_user),
@@ -58,7 +58,7 @@ async def download_version_docx(
)
@router.post("/", response_model=DocumentResponse)
@router.post("", response_model=DocumentResponse)
async def upload_document(
title: str = Form(...),
description: str | None = Form(default=None),

View File

@@ -17,7 +17,7 @@ from dlib.auth import AuthenticatedUser
router = APIRouter(prefix="/submissions", tags=["submissions"])
@router.post("/", response_model=SubmissionResponse)
@router.post("", response_model=SubmissionResponse)
async def create_submission_endpoint(
payload: SubmissionCreateRequest,
session: AsyncSession = Depends(get_db),

View File

@@ -9,7 +9,7 @@ from app.db.session import lifespan
settings = get_settings()
app = FastAPI(title=settings.project_name, lifespan=lifespan)
app = FastAPI(title=settings.project_name, lifespan=lifespan, redirect_slashes=False)
app.add_middleware(
CORSMiddleware,