Skip to content

chore: address leftover review nits from recently merged PRs - #1501

Merged
pjfanning merged 1 commit into
apache:mainfrom
pjfanning:cleanup-he-pin-review-nits
Nov 19, 2026
Merged

pjfanning merged 1 commit into
apache:mainfrom
pjfanning:cleanup-he-pin-review-nits

Conversation

@pjfanning

Copy link
Copy Markdown
Member

Motivation:
Several recently merged PRs left review points unaddressed. This PR collects them in one place. Each change below links to the review comment that asked for it.

Modification:

  • Scala FilenameEncoding alias (#1494 review, first nit): Multipart.FormData.FilenameEncoding is now a Scala alias for the Java enum, with Extended, Ascii and PercentEncoded values. The Scala toEntity(boundary, encoding) signature uses it (same erasure), and the tests take the values from the public API instead of the internal BodyPartRenderer.
  • Render form-data Content-Disposition directly (#1494 review, second nit): BodyPartRenderer used to build the header by rendering it twice and slicing off the prefix. It now renders the header in one pass. The output is unchanged; the existing MultipartSpec byte-level tests cover it.
  • Drop the URI surrogate docs paragraph (#1426 review, point 2): it described a bug fix as if it were intended behaviour.
  • Drop the cookie -0000 docs sentence (#1493 review, first nit): it was out of place in "Collecting headers".
  • javadsl Multipart.FormData doc: it still said "All parts must have distinct names. (This is not verified!)" and cited RFC 2388. #1483 fixed only the scaladsl doc; RFC 7578 §4.3 allows several parts with the same name.
  • Keep the cookie date rule copies in sync (#1458 review, point 1): comments link IMF-fixdate/asctime-date to their cookie-* copies. They had already drifted, since fix: accept zero-offset Cookie Expires dates #1493 added -0000 only to the cookie versions.
  • Test other methods starting with Q (#1477 review): custom QUOTE and QUERYX methods still reach the custom method lookup next to the QUERY fast path.
  • HeaderCompressionSpec imports and timeout (#1438 review): one import org.apache.pekko root import, and 3.seconds.dilated.
  • Explicit isTrailer (#1463 review): HttpMessageRendering.renderHeaders takes isTrailer instead of inferring it from !shouldRenderAutoHeaders.
  • Remove unused forwarding overloads (Reject unsupported extensions in WebSocket client upgrade responses #1436, Avoid premature HTTP/2 ping timeouts after scheduler pauses #1462; same reasoning as #1457 review, point 3): the three-argument Handshake.Client.validateResponse had no callers, and EnabledPingState's secondary constructor is replaced by a default for the clock. Both are internal, and http-core/mimaReportBinaryIssues passes without excludes.
  • Media type model checks in http-core (#1437 review, #1454 review): the Java constant, ContentType.parse and forExtension checks for wasm, avif and zstd move from FileAndResourceDirectivesSpec to a new MediaTypesSpec. The routing spec keeps its resolver cases.
  • WebSocket key hashing (#1439 review, point 3): key.key.asciiBytes instead of String.valueOf(key.key).asciiBytes. A parsed or generated key is never null.

Result:
The review points are addressed. The only public API change is the added Scala FilenameEncoding alias and values. Everything else is internal, tests or docs.

Tests:

  • http-core/testOnly MultipartSpec MultipartsSpec MediaTypesSpec RequestParserCRLFSpec RequestParserLFSpec HeaderCompressionSpec WebSocketClientSpec HeaderSpec HttpHeaderSpec: 314 passed
  • http2-tests/testOnly HttpMessageRenderingSpec Http2PingSchedulingSpec: 38 passed
  • http-tests/testOnly FileAndResourceDirectivesSpec: 63 passed
  • http-core/mimaReportBinaryIssues: passed

References:
Refs #1426, #1436, #1437, #1438, #1439, #1454, #1458, #1462, #1463, #1477, #1483, #1493, #1494

🤖 Generated with Claude Code

Motivation:
Several recently merged PRs left review points unaddressed: docs that
were asked to be dropped, comments and tests that were suggested, and
small API and internal tidy-ups.

Modification:
- Add a Scala FilenameEncoding alias and values to Multipart.FormData
  and use them in the Scala toEntity signature and tests (apache#1494).
- Render the form-data Content-Disposition header directly instead of
  rendering it twice and slicing off the prefix (apache#1494).
- Drop the docs paragraph about unpaired URI surrogates (apache#1426) and the
  cookie -0000 sentence in request-level.md (apache#1493).
- Fix the javadsl Multipart.FormData doc the same way apache#1483 fixed the
  scaladsl one.
- Comment the cookie date rule copies so they stay in sync (apache#1458).
- Test custom methods starting with Q next to the QUERY fast path
  (apache#1477).
- Use one root package import and a dilated timeout in
  HeaderCompressionSpec (apache#1438).
- Pass isTrailer to HttpMessageRendering.renderHeaders explicitly
  (apache#1463).
- Remove the unused forwarding overloads in Handshake.Client and
  EnabledPingState (apache#1436, apache#1462).
- Move the media type model checks from the routing spec to a new
  http-core MediaTypesSpec (apache#1437, apache#1454).
- Hash the WebSocket key without String.valueOf (apache#1439).

Result:
The review points are addressed. The only public API change is the
added Scala FilenameEncoding alias.

Tests:
- http-core/testOnly MultipartSpec MultipartsSpec MediaTypesSpec
  RequestParserCRLFSpec RequestParserLFSpec HeaderCompressionSpec
  WebSocketClientSpec HeaderSpec HttpHeaderSpec: 314 passed
- http2-tests/testOnly HttpMessageRenderingSpec Http2PingSchedulingSpec:
  38 passed
- http-tests/testOnly FileAndResourceDirectivesSpec: 63 passed
- http-core/mimaReportBinaryIssues: passed

References:
Refs apache#1426, apache#1436, apache#1437, apache#1438, apache#1439, apache#1454, apache#1458, apache#1462, apache#1463,
apache#1477, apache#1483, apache#1493, apache#1494
@pjfanning pjfanning added this to the 2.1.0 milestone Nov 18, 2026
@pjfanning
pjfanning requested a review from He-Pin November 18, 2026 21:30
@pjfanning
pjfanning merged commit e3612a8 into apache:main Nov 19, 2026
6 checks passed
@pjfanning
pjfanning deleted the cleanup-he-pin-review-nits branch November 19, 2026 22:36
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.

2 participants