File size: 617 Bytes
f9aae2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""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,
)