Skip to content

Apply response settings to early final Expect responses - #333

Open
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/early-http
Open

Apply response settings to early final Expect responses#333
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/early-http

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Apply response body encoding, ignore_eof and URI after the response catch, so early final responses to Expect: 100-continue receive the same settings as normal final responses.

Reproduction

Against a bounded local TCP server, send a POST with Expect: 100-continue and continue_timeout=1. Have the server immediately return 417 with a UTF-8 body. Set response_body_encoding=Encoding::UTF_8: before, response.uri is nil and the body is ASCII-8BIT. With ignore_eof=false and a truncated declared body, the early response also incorrectly accepts EOF. All three settings are respected after this change.

Verification

  • Ruby 4.0.6 through rbenv; existing bundle exec rake test: 201 tests, 914 assertions, zero failures/errors, both baseline and this isolated patch.
  • 24 checks over real loopback sockets cover early 417 and normal 100→200 responses, plain/gzip bodies, exact content, URI, encoding, decoded compression and strict EOF. Every socket/thread has bounded waits and cleanup.
  • Ruby syntax and git diff --check pass. Supplemental Lint scan retains the same 25 pre-existing findings; no new findings by file/cop.
  • No test/spec files were added or modified, per this contribution's explicit no-new-tests constraint. Focused reproductions were run externally.

Compatibility and limitations

No API or dependency change. Intentional correction: early final responses now honor configured strict EOF handling and body encoding. This does not change informational-response limits or Expect parsing.

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.

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.

1 participant