DocDoeAI / app /core /http_status.py
asnannp's picture
deploy: sync backend to Space root (learn-lesson HF cache fix)
f9aae2c
Raw
History Blame Contribute Delete
617 Bytes
"""Starlette status aliases that work on both old and new releases.
Starlette renamed 413/422 constants. CI's newer package has the new names and
deprecates the old ones; older local installs only have the old names.
"""
from __future__ import annotations
from starlette import status as starlette_status
HTTP_413_CONTENT_TOO_LARGE = getattr(
starlette_status,
"HTTP_413_CONTENT_TOO_LARGE",
starlette_status.HTTP_413_REQUEST_ENTITY_TOO_LARGE,
)
HTTP_422_UNPROCESSABLE_CONTENT = getattr(
starlette_status,
"HTTP_422_UNPROCESSABLE_CONTENT",
starlette_status.HTTP_422_UNPROCESSABLE_ENTITY,
)