Skip to content

security: add ReadTimeout and WriteTimeout to API server#830

Open
tejas0077 wants to merge 1 commit intogetprobo:mainfrom
tejas0077:fix/add-api-server-timeouts
Open

security: add ReadTimeout and WriteTimeout to API server#830
tejas0077 wants to merge 1 commit intogetprobo:mainfrom
tejas0077:fix/add-api-server-timeouts

Conversation

@tejas0077
Copy link

@tejas0077 tejas0077 commented Mar 13, 2026

Found an inconsistency while reading the codebase.

The trust center HTTPS server has ReadTimeout and
WriteTimeout set to 30 seconds. The API server has
neither.

Same codebase. Same risk. Different treatment.

Without these, a slow client can trickle request body
data indefinitely — keeping connections open and quietly
exhausting server resources.

One-line fix. Two timeouts. Consistent behavior across
both servers.

apiServer.ReadTimeout = 30 * time.Second
apiServer.WriteTimeout = 30 * time.Second

Not glamorous. Just the kind of thing that matters before
a compliance platform goes to production.


Summary by cubic

Set 30s ReadTimeout and WriteTimeout on the API server. This prevents slow clients from holding connections open and aligns with the trust center HTTPS server.

Written for commit 95c0278. Summary will update on new commits.

Signed-off-by: Tejas Saubhage <tsaubhage0007@gmail.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant