pjfanning opened a new pull request, #1908: URL: https://github.com/apache/pekko-connectors/pull/1908
### Motivation `convertHeaders` parsed the `Content-Length` request header with a bare `.toLong`: a negative value flowed unchecked into a fixed-length entity, and a malformed value surfaced as a raw `NumberFormatException` instead of the module's usual "Found invalid header" style of error. ### Modification Parse `Content-Length` via a `parseContentLength` helper that rejects non-numeric and negative values with an `IllegalArgumentException` naming the offending value. ### Result Negative `Content-Length` values are rejected instead of producing an invalid entity; malformed values produce a consistent, descriptive error. ### Tests - `sbt "aws-spi-pekko-http/Test/testOnly org.apache.pekko.stream.connectors.awsspi.PekkoHttpClientSpec"` — 13 passed, 2 new tests: the negative-value test fails without the fix (verified by reverting the main source); the non-numeric test is characterization, since `NumberFormatException` already extends `IllegalArgumentException` - `sbt "aws-spi-pekko-http/mimaReportBinaryIssues"` — no issues - `scalafmt --mode diff-ref=origin/main` — clean; no Java files changed, no new files (no header changes needed) ### References None - found during a review of the aws-spi-pekko-http client 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
