Match the 100-continue expectation case-insensitively - #334
Closed
OskarEichler wants to merge 1 commit into
Closed
Conversation
Author
|
Superseded by #341, which preserves the case-insensitive match from this patch and also handles comma-separated Expect field values without substring false positives. Closing this narrower version so there is one canonical implementation to review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Match the 100-continue expectation case-insensitively, using casecmp? on each existing header value. RFC 9110 section 10.1.1 specifies case-insensitive expectation values.
Reproduction
Provide Expect: 100-CONTINUE to a POST with a continue timeout and a socket ready to return an early 417. Before, wait_for_continue skips the readiness check and early response. After, it behaves identically to lower-case 100-continue.
Verification
bundle exec rake test: 201 tests, 914 assertions, zero failures/errors, both baseline and this isolated patch.git diff --checkpass. Supplemental Lint scan retains the same 25 pre-existing findings; no new findings by file/cop.Compatibility and limitations
No API or dependency change. Mixed-case 100-continue now engages the same wait behavior as lower-case. Matching remains exact per header field; comma-list parsing and quoted parameters are not introduced.
Based on master
23e859e92e10e43cad520fcacac3fd43640dba7b. Optional external OpenSSL tests and other Ruby/OS combinations were not run. Existing related issues/PRs were checked; this is a focused correctness change, not a claim of exhaustive coverage.Reference: https://www.rfc-editor.org/rfc/rfc9110.html#section-10.1.1