Skip to content

Commit cc094a5

Browse files
committed
DeprecationWarning: 'HTTP_413_REQUEST_ENTITY_TOO_LARGE' is deprecated. Use 'HTTP_413_CONTENT_TOO_LARGE' instead.
Reason for this is that in Kludex/starlette@40a8147 they changed the enum to match https://www.rfc-editor.org/rfc/rfc9110#name-413-content-too-large starlette release specifier due to this only being changed in https://github.com/Kludex/starlette/releases/tag/0.48.0
1 parent 2acd838 commit cc094a5

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ classifiers = [
2929
]
3030

3131
[project.optional-dependencies]
32-
http-server = ["fastapi>=0.115.2", "sse-starlette", "starlette"]
32+
http-server = ["fastapi>=0.115.2", "sse-starlette", "starlette>=0.48.0"]
3333
encryption = ["cryptography>=43.0.0"]
3434
grpc = ["grpcio>=1.60", "grpcio-tools>=1.60", "grpcio_reflection>=1.7.0"]
3535
telemetry = ["opentelemetry-api>=1.33.0", "opentelemetry-sdk>=1.33.0"]

src/a2a/server/apps/jsonrpc/jsonrpc_app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
from starlette.exceptions import HTTPException
6565
from starlette.requests import Request
6666
from starlette.responses import JSONResponse, Response
67-
from starlette.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE
67+
from starlette.status import HTTP_413_CONTENT_TOO_LARGE
6868

6969
_package_starlette_installed = True
7070
else:
@@ -76,7 +76,7 @@
7676
from starlette.exceptions import HTTPException
7777
from starlette.requests import Request
7878
from starlette.responses import JSONResponse, Response
79-
from starlette.status import HTTP_413_REQUEST_ENTITY_TOO_LARGE
79+
from starlette.status import HTTP_413_CONTENT_TOO_LARGE
8080

8181
_package_starlette_installed = True
8282
except ImportError:
@@ -90,7 +90,7 @@
9090
Request = Any
9191
JSONResponse = Any
9292
Response = Any
93-
HTTP_413_REQUEST_ENTITY_TOO_LARGE = Any
93+
HTTP_413_CONTENT_TOO_LARGE = Any
9494

9595

9696
class StarletteUserProxy(A2AUser):
@@ -381,7 +381,7 @@ async def _handle_requests(self, request: Request) -> Response: # noqa: PLR0911
381381
None, A2AError(root=JSONParseError(message=str(e)))
382382
)
383383
except HTTPException as e:
384-
if e.status_code == HTTP_413_REQUEST_ENTITY_TOO_LARGE:
384+
if e.status_code == HTTP_413_CONTENT_TOO_LARGE:
385385
return self._generate_error_response(
386386
request_id,
387387
A2AError(

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)