Branch: refs/heads/fix/sonar-extension-http-client-resource-leak Home: https://github.com/xwiki/xwiki-platform Commit: 1416c842babbf6c091681cf88c66143d3813a231 https://github.com/xwiki/xwiki-platform/commit/1416c842babbf6c091681cf88c661... Author: Vincent Massol <[email protected]> Date: 2026-05-13 (Wed, 13 May 2026) Changed paths: M xwiki-platform-core/xwiki-platform-repository/xwiki-platform-repository-server-api/src/main/java/org/xwiki/repository/internal/resources/ExtensionVersionFileRESTResource.java Log Message: ----------- [SONAR] Stream HTTP response back to caller instead of buffering it in memory The previous version of this fix used EntityUtils.toByteArray to buffer the entire extension content in memory before sending it to JAX-RS. This was a memory regression compared to the original streaming behavior: large extensions or many parallel downloads could cause OOM. Restore streaming by: - Using executeOpen() to get the ClassicHttpResponse without using the response handler pattern (which doesn't fit streaming). - Wrapping the entity InputStream in a FilterInputStream whose close() transitively closes the HTTP response and the HTTP client. JAX-RS calls close() on the entity stream after writing the response, so resources are released the same way the original code intended (it just never closed the client at all). - Releasing the response and client in a finally block if the handoff to JAX-RS fails before the stream is set on the response. https://sonarcloud.io/project/issues?id=org.xwiki.platform:xwiki-platform&is... To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications