Skip to content

fix(auth): add timeout to login backend HTTP client#52

Open
edospadoni wants to merge 1 commit into
mainfrom
fix-login-client-timeout
Open

fix(auth): add timeout to login backend HTTP client#52
edospadoni wants to merge 1 commit into
mainfrom
fix-login-client-timeout

Conversation

@edospadoni
Copy link
Copy Markdown
Member

Summary

The http.Client used in middleware/middleware.go to forward /login requests to the legacy NetCTI backend was created with no Timeout. If the backend leaves the response unfinished (for example an unhandled exception path that never writes a status line and never closes the connection), the call to client.Do(req) will block indefinitely.

In practice this means the goroutine handling the login stays parked and the underlying TCP connection to the backend is kept open with no upper bound, in some cases for days.

All other http.Client instances in this repository already set a Timeout (see methods/auth.go, methods/history.go, methods/voicemail.go, methods/proxy.go, store/persistence.go); this change restores consistency by setting Timeout: 30 * time.Second on the login client as well.

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