Skip to content

[ws-manager] Fix potential leak of request body #13957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2022
Merged

[ws-manager] Fix potential leak of request body #13957

merged 1 commit into from
Oct 18, 2022

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Oct 18, 2022

Description

Ensure we close the body of the request.

Modifies the change introduced in #13828

How to test

  • Workspaces should open.

Release Notes

NONE

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-integration-tests=workspace
    Valid options are all, workspace, webapp, ide

@aledbf aledbf requested a review from a team October 18, 2022 13:39
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-aledbf-fixl.1 because the annotations in the pull request description changed
(with .werft/ from main)

@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Oct 18, 2022
@roboquat roboquat added size/M and removed size/XS labels Oct 18, 2022
@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-aledbf-fixl.4 because the annotations in the pull request description changed
(with .werft/ from main)

@Furisto
Copy link
Member

Furisto commented Oct 18, 2022

You need to rebase. This will fix the failing build.

@aledbf
Copy link
Member Author

aledbf commented Oct 18, 2022

/werft run

👍 started the job as gitpod-build-aledbf-fixl.6
(with .werft/ from main)

@roboquat roboquat merged commit 791362b into main Oct 18, 2022
@roboquat roboquat deleted the aledbf/fixl branch October 18, 2022 18:52
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Oct 19, 2022
@@ -95,28 +125,13 @@ func (p *WorkspaceReadyProbe) Run(ctx context.Context) WorkspaceProbeResult {
continue
}

if resp.StatusCode != http.StatusOK {
resp.Body.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the potential leak? It looks like we only have 2 exit point, one is here, and another one is below, both case all have resp.Body.Close()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/M team: workspace Issue belongs to the Workspace team
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants