Skip to content

Test case-sensitive HTTP/1.1 custom method round trips - #1701

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/h1-case-sensitive-custom-methods
Nov 28, 2026
Merged

He-Pin merged 1 commit into
apache:mainfrom
He-Pin:test/h1-case-sensitive-custom-methods

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 27, 2026

Copy link
Copy Markdown
Member

Motivation

HTTP method names are case-sensitive. Existing custom method examples exercise one uppercase token but do not round-trip two registered case variants.

Modification

Register two names that differ only in case and send one modeled request for each over the same HTTP/1.1 loopback connection. Assert the exact names observed by the server and clean up the connection.

Result

The test covers the client renderer and server parser together without changing production behavior.

Tests

The focused ClientServerSpec case passed with stock project sbt on Temurin JDK 17 on both Scala 2.13.18 and Scala 3.3.9. Test formatting passed.

References

RFC 9110 §9.1; #1477 covers separate QUERY parser behavior.

Motivation:
HTTP method names are case-sensitive. The existing custom method
example covers a single uppercase name but not two case variants.

Modification:
Register two distinct custom methods and send modeled requests over
one HTTP/1.1 loopback connection. Drain the entities and verify the
exact method names observed by the server against the original names.

Result:
The test covers the client renderer and server parser together.
No production behavior or defaults change.

Tests:
- Stock http-core Test ClientServerSpec focused case: 1 passed on
  Scala 2.13.18 and 1 passed on Scala 3.3.9 using Temurin 17.
- http-core / Test / scalafmtCheck and git diff --check passed.

References:
RFC 9110, section 9.1. Refs apache#1477 (adjacent QUERY parser coverage).
@He-Pin
He-Pin marked this pull request as ready for review November 27, 2026 09:09
@He-Pin
He-Pin requested a review from pjfanning November 27, 2026 09:09

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@He-Pin
He-Pin merged commit f683b8f into apache:main Nov 28, 2026
6 checks passed
@He-Pin
He-Pin deleted the test/h1-case-sensitive-custom-methods branch November 28, 2026 12:34
@pjfanning pjfanning added this to the 2.1.0 milestone Nov 29, 2026
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