Skip to content

fix: fix potential connection leaks on non-ok http status codes#110

Merged
mgoetzegb merged 2 commits intomain-gbfrom
fix-connection-leak
Nov 28, 2025
Merged

fix: fix potential connection leaks on non-ok http status codes#110
mgoetzegb merged 2 commits intomain-gbfrom
fix-connection-leak

Conversation

@mgoetzegb
Copy link
Member

What

fix: fix potential connection leaks on non-ok http status codes

Even the response of a non-ok http status code can contain a body. So we should close the body of a (on transport layer) sucessful request unconditionally. Otherwise we can leak a http connection.

Why

Don't leak connections.

@mgoetzegb mgoetzegb requested a review from a team as a code owner November 24, 2025 10:38
@greenbonebot

This comment was marked as resolved.

@github-actions
Copy link

Conventional Commits Report

Type Number
Bug Fixes 1

🚀 Conventional commits found.

@github-actions
Copy link

Modver result

This report was generated by Modver,
a Go package and command that helps you obey semantic versioning rules in your Go module.

This PR does not require a change in your module’s version number.
(You might still consider bumping the patchlevel anyway.)

@mgoetzegb mgoetzegb enabled auto-merge (squash) November 25, 2025 14:19
@mgoetzegb mgoetzegb added the patch release Set label to create a patch release label Nov 25, 2025
Even the response of a non-ok http status code can contain a body. So we should close the body of a (on transport layer) sucessful request unconditionally. Otherwise we can leak a http connection.
For the regular client http body is guaranteed to be set if there is no error on transport level. Fake client should do the same.
@mgoetzegb mgoetzegb merged commit cd8cfa8 into main-gb Nov 28, 2025
5 of 7 checks passed
@mgoetzegb mgoetzegb deleted the fix-connection-leak branch November 28, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch release Set label to create a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants