Skip to content

Commit 3e65534

Browse files
committed
remove unnceserray upload checks
1 parent 68ead66 commit 3e65534

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

backend/endpoints/roms/upload.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,6 @@ async def upload_chunk(
206206
detail="Chunk exceeds maximum allowed size",
207207
)
208208

209-
if content_length_bytes != expected_chunk_size:
210-
raise HTTPException(
211-
status_code=status.HTTP_400_BAD_REQUEST,
212-
detail=(
213-
f"Unexpected chunk size for index {chunk_index}: "
214-
f"expected {expected_chunk_size}, got {content_length_bytes}"
215-
),
216-
)
217-
218209
chunk_path = ROM_UPLOAD_TMP_BASE / upload_id / f"{chunk_index:05d}"
219210
chunk_bytes_written = 0
220211

@@ -227,24 +218,7 @@ async def upload_chunk(
227218
status_code=status.HTTP_413_REQUEST_ENTITY_TOO_LARGE,
228219
detail="Chunk exceeds maximum allowed size",
229220
)
230-
if chunk_bytes_written > expected_chunk_size:
231-
raise HTTPException(
232-
status_code=status.HTTP_413_REQUEST_ENTITY_TOO_LARGE,
233-
detail=(
234-
f"Chunk index {chunk_index} exceeds expected size "
235-
f"{expected_chunk_size}"
236-
),
237-
)
238221
await f.write(body_chunk)
239-
240-
if chunk_bytes_written != expected_chunk_size:
241-
raise HTTPException(
242-
status_code=status.HTTP_400_BAD_REQUEST,
243-
detail=(
244-
f"Unexpected chunk size for index {chunk_index}: "
245-
f"expected {expected_chunk_size}, got {chunk_bytes_written}"
246-
),
247-
)
248222
except Exception as exc:
249223
if chunk_path.exists():
250224
chunk_path.unlink()

0 commit comments

Comments
 (0)