Skip to content

POST /entries connection is kept when content-length value is large but no content is present #247

@ivarprudnikov

Description

@ivarprudnikov

A simple local test can illustrate the issue when posting empty data but with the content length set to a high number:

curl -k -H 'Content-Type: application/cose' -H 'Content-Length: 134217720' -d '' https://localhost:8000/entries
... after a minute
curl: (52) Empty reply from server

Logs for the above request would look like:

2024-12-05T15:49:15.800653Z -0.006 0   [info ][app] /tmp/app/src/tracing.h:130      | RequestId=36dada033b48885 Verb=POST Path=/entries URL=/entries Status=400 TimeMs=0
2024-12-05T15:50:29.776243Z        100 [info ] ../src/host/rpc_connections.h:458    | Closing socket 8443 after 61s idle (max = 60s)

We could just respond immediately without keeping the connection open.

Metadata

Metadata

Assignees

Labels

depends-on-ccfIt depends on upstream changes from CCF

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions