slachiewicz opened a new pull request, #2122: URL: https://github.com/apache/maven-resolver/pull/2122
Ports the bounded error-body read from `master` (#2081) to the 1.9.x line. On this line `RFC9457Reporter` is a concrete class inside `maven-resolver-transport-http` rather than the SPI abstraction `master` has, so this is a port rather than a cherry-pick. `getBody` previously handed the whole entity to `EntityUtils.toString`, so the size of an error response body was decided by the server. It now reads at most 64 KiB (`MAX_BODY_BYTES`) and leaves the rest unread. A body that does not parse as problem details, including one truncated at the limit, no longer surfaces as a `JsonSyntaxException` from `RFC9457Parser`: `generateException` returns and `HttpTransporter.handleStatus` reports the plain `HttpResponseException` for the status, the same fallback `master` uses. The test server gained two `rfc9457/` paths, a non-JSON body and a payload larger than the limit, and both are expected to arrive as a plain 403 rather than as problem details. Verified: `mvn -pl maven-resolver-transport-http -am verify` -> BUILD SUCCESS, 91 tests in the module, 0 failures; `spotless:apply` produced no further changes. *This change was created with AI assistance.* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
