Skip to content

Bump Java HTTP to 1.4.2 - #54

Merged
JohnBergant merged 1 commit into
mainfrom
publish-1.4.2
Sep 1, 2026
Merged

Bump Java HTTP to 1.4.2#54
JohnBergant merged 1 commit into
mainfrom
publish-1.4.2

Conversation

@JohnBergant

Copy link
Copy Markdown
Contributor

Problems

  1. When handling chunked transfer encoding, if we can't read a byte from the underlying pushback stream, we end up an infinite loop. We also don't handle offset/dLen edge cases well and do not deliberately handle chunk sizes larger than Integer.MAX_VALUE.
  2. Old IPR file style (modern IJ crashes)
  3. Pre Savant 2.2.0 style IML
  4. IJ's TestNG run config template could not properly run tests
  5. GHA did not run tests on PRs and had old Savant version.

Solutions

  1. When handling chunked transfer encoding, if we can't read a byte from the underlying pushback stream, then bail. Also simplify and cover other edge cases (length of zero, length/offset bigger than destination buffer, and conflation of index/length).
  2. Convert to the .idea directory
  3. IML update.
  4. Standard run config
  5. Have GHA run tests on PRs and update Savant version.

Problems
1. When handling chunked transfer encoding, if we can't read a byte from the underlying pushback stream, we end up an infinite loop. We also don't handle offset/dLen edge cases well and do not deliberately handle chunk sizes larger than Integer.MAX_VALUE.
2. Old IPR file style (modern IJ crashes)
3. Pre Savant 2.2.0 style IML
4. IJ's TestNG run config template could not properly run tests
5. GHA did not run tests on PRs and had old Savant version.

Solutions
1. When handling chunked transfer encoding, if we can't read a byte from the underlying pushback stream, then bail. Also simplify and cover other edge cases (length of zero, length/offset bigger than destination buffer, and conflation of index/length).
2. Convert to the .idea directory
3. IML update.
4. Standard run config
5. Have GHA run tests on PRs and update Savant version.
Copilot AI lite review requested due to automatic review settings September 1, 2026 17:06
@JohnBergant
JohnBergant requested review from a team as code owners September 1, 2026 17:06
@JohnBergant JohnBergant changed the title Fix issues with chunked transfer encoding (#1) Bump Java HTTP to 1.4.2 Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 bumps java-http to 1.4.2 and focuses on hardening chunked transfer decoding (preventing hangs / handling offset+length edge cases and oversized chunk sizes), while also modernizing IntelliJ project files and updating CI to run tests on pull requests.

Changes:

  • Fix/refactor ChunkedInputStream to better handle chunked parsing edge cases (incomplete reads, offset/length validation, oversized chunk sizes).
  • Expand chunked-related test coverage, including new regression cases.
  • Migrate IntelliJ project config from legacy .ipr to .idea/, and update GitHub Actions workflow + Savant bootstrap.

Reviewed changes

Copilot reviewed 10 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/java/io/fusionauth/http/io/ChunkedInputStream.java Refactors chunked decoding logic and adds explicit handling for edge cases and oversized chunk sizes.
src/test/java/io/fusionauth/http/io/ChunkedInputStreamTest.java Adds regression tests for chunked parsing edge cases (offset/length, incomplete streams, oversized chunk size).
src/test/java/io/fusionauth/http/ChunkedTest.java Adds integration test for integer-overflow chunk sizes and keeps existing chunked request/response coverage.
pom.xml Bumps Maven artifact version to 1.4.2.
build.savant Bumps Savant project version to 1.4.2.
.github/workflows/test.yml Runs tests on PRs, updates runner/tooling, and updates Savant installation steps.
java-http.iml Updates IntelliJ module metadata (dependency paths/source jars).
load-tests/tomcat/tomcat.iml Normalizes module file formatting.
load-tests/self/self.iml Normalizes module file formatting.
java-http.ipr Removes legacy IntelliJ .ipr project file.
.idea/vcs.xml Adds modern IntelliJ VCS mapping.
.idea/runConfigurations/_template__of_TestNG.xml Adds standard TestNG run configuration template.
.idea/modules.xml Adds IntelliJ modules list for the project.
.idea/misc.xml Adds project SDK/language level configuration.
.idea/libraries/_kts_definition_dependencies.xml Adds Kotlin script definition dependency library entry used by IntelliJ.
.idea/copyright/profiles_settings.xml Adds IntelliJ copyright profile settings.
.idea/copyright/Apache_v2.xml Adds IntelliJ Apache v2 copyright notice template.
.idea/compiler.xml Adds IntelliJ compiler/javac options configuration.
.idea/.gitignore Adds ignores for user-local IntelliJ files inside .idea/.
Files not reviewed (9)
  • .idea/.gitignore: Generated file
  • .idea/compiler.xml: Generated file
  • .idea/copyright/Apache_v2.xml: Generated file
  • .idea/copyright/profiles_settings.xml: Generated file
  • .idea/libraries/_kts_definition_dependencies.xml: Generated file
  • .idea/misc.xml: Generated file
  • .idea/modules.xml: Generated file
  • .idea/runConfigurations/_template__of_TestNG.xml: Generated file
  • .idea/vcs.xml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +28 to 31
savant-2.2.0/bin/sb --version
SAVANT_PATH=$(realpath -s "./savant-2.2.0/bin")
echo "${SAVANT_PATH}" >> $GITHUB_PATH
mkdir -p ~/.savant/plugins
Comment on lines +80 to +82
if (delegateBufferLength == -1) {
return -1;
}
Comment on lines +177 to +178
// I'm not sure what the need for this is as of now. None of the existing code paths use it. could be
// useful for HTTP/2 in the future
Comment on lines +223 to +224
@Test
public void chunk_larger_than_32_bytes() throws IOException {
@JohnBergant
JohnBergant merged commit 4bb098e into main Sep 1, 2026
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