Skip to content

task: Use getInputStream to get data - #378

Merged
chriswk merged 3 commits into
mainfrom
task/useGetInputStream
May 22, 2026
Merged

task: Use getInputStream to get data#378
chriswk merged 3 commits into
mainfrom
task/useGetInputStream

Conversation

@chriswk

@chriswk chriswk commented May 22, 2026

Copy link
Copy Markdown
Member

As reported in #377 - getContent() uses serviceloaders to locate the correct content processor. With GraalVM, depending on your configuration it can locate the wrong content processor and give you bad data.

We've already checked that we don't have a gzip stream, so we're trusting our upstream to return application/json and do not need a content processor. This saves us a cast from content to InputStream as well.

fixes: #377

As reported in #377 - getContent() when building with GraalVM uses serviceloaders to locate the correct content processor.
But we've already checked that we don't have a gzip
stream, so we're trusting our upstream to return application/json and do
not need a content processor. This saves us a cast from content to
InputStream as well.

fixes: #377

@gastonfournier gastonfournier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good

@github-project-automation github-project-automation Bot moved this from New to Approved PRs in Issues and PRs May 22, 2026
@coveralls

coveralls commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 26277735635

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.3%) to 79.944%

Details

  • Coverage increased (+0.3%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4249
Covered Lines: 3524
Line Coverage: 82.94%
Relevant Branches: 1116
Covered Branches: 765
Branch Coverage: 68.55%
Branches in Coverage %: Yes
Coverage Strength: 9.68 hits per line

💛 - Coveralls

@gastonfournier
gastonfournier requested a review from Copilot May 22, 2026 08:42
@chriswk
chriswk enabled auto-merge (squash) May 22, 2026 08:42
@chriswk
chriswk merged commit 1bcf066 into main May 22, 2026
11 checks passed
@chriswk
chriswk deleted the task/useGetInputStream branch May 22, 2026 08:43
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Issues and PRs May 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the HttpFeatureFetcher to read response bodies via HttpURLConnection#getInputStream() instead of getContent(), avoiding ServiceLoader-based content handler resolution that can break under GraalVM native-image (as reported in #377). It also corrects a malformed Maven project version string in the root pom.xml.

Changes:

  • Replace (InputStream) request.getContent() with request.getInputStream() when reading the non-gzip JSON response body.
  • Fix pom.xml project version from 12.2.2-SNAPSHOT-SNAPSHOT to 12.2.2-SNAPSHOT.
  • Minor XML formatting/indentation adjustment around distributionManagement within the publication profile.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/java/io/getunleash/repository/HttpFeatureFetcher.java Avoids getContent() content-handler resolution by reading the response via getInputStream() (more reliable under GraalVM).
pom.xml Fixes malformed project version and tidies indentation near profile distribution management.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

HttpFeatureFetcher with GraalVM

5 participants