Skip to content

fix: add HTTP server timeouts for local network test helper (G114)#843

Open
arianbeh wants to merge 2 commits intofirecracker-microvm:mainfrom
arianbeh:fix-g114-timeouts
Open

fix: add HTTP server timeouts for local network test helper (G114)#843
arianbeh wants to merge 2 commits intofirecracker-microvm:mainfrom
arianbeh:fix-g114-timeouts

Conversation

@arianbeh
Copy link
Copy Markdown
Contributor

Fixes #807.

This patch replaces a raw http.ListenAndServe() call in
internal/network_test_utils.go with an explicit http.Server
configured with ReadTimeout, WriteTimeout, and IdleTimeout to satisfy
gosec rule G114 ("Use of net/http serve function without timeouts").

This code is used only in test helpers and does not affect runtime
behavior.

Validated locally with:

  • make lint
  • go test ./internal/...

Signed-off-by: Aryan Behmardi

Signed-off-by: Aryan Behmardi <arianbehmard@gmail.com>
@arianbeh arianbeh requested a review from a team as a code owner December 10, 2025 18:50
Comment thread .golangci.yml Outdated
Signed-off-by: Aryan Behmardi <arianbehmard@gmail.com>
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.

Resolve G114 use of net/http serve function that has no support for setting timeouts

2 participants