Skip to content
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

Always close the IMDS response body #478

Merged
merged 1 commit into from
May 7, 2024

Conversation

qmuntal
Copy link
Contributor

@qmuntal qmuntal commented Apr 9, 2024

The http.Response body should always be closed, even for non-200 status codes. Not doing so leaks the system resources associated to the body.

While here, associate the context passed in detectRegion to the http request. It was previously not being used.

Copy link

sonarqubecloud bot commented Apr 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@qmuntal qmuntal changed the title always close IMDS response body Always close the IMDS response body Apr 9, 2024
@epelc
Copy link
Contributor

epelc commented Apr 23, 2024

Can this get merged? It's a good fix. Adds context usage and fixes leaks.

@bgavrilMS bgavrilMS merged commit ae2db6b into AzureAD:main May 7, 2024
2 checks passed
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.

3 participants