Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the Ruby-facing documentation and behavior around orig_headers, aligning it with the underlying Rust/Wreq capability to preserve original header order and casing for HTTP/1 requests. It also adds an integration-style test suite to validate header ordering/casing preservation across several shuffled input cases.
Changes:
- Update Ruby docs to describe
orig_headersasArray<String>(ordered header names) rather than a hash. - Add
OrigHeadersRust wrapper + conversion logic to feedwreq::header::OrigHeaderMapinto client/request builders. - Add new Ruby tests that verify echoed HTTP/1 headers preserve order and case when
orig_headersis provided.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/orig_header_test.rb | Adds HTTP/1 header order/casing preservation tests using orig_headers. |
| src/header.rs | Introduces OrigHeaders wrapper and TryConvert from Ruby arrays. |
| src/extractor.rs | Removes unused Version extractor implementation and updates imports. |
| src/error.rs | Adds type_value_error_to_magnus helper for consistent type/value errors. |
| src/client/req.rs | Plumbs orig_headers through request keyword parsing and into the request builder. |
| src/client.rs | Plumbs orig_headers through client keyword parsing and into the client builder. |
| lib/wreq.rb | Updates module method YARD docs to reflect orig_headers as Array<String>. |
| lib/wreq_ruby/client.rb | Updates client and instance method YARD docs to reflect orig_headers as Array<String>. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+181
to
+187
| let rarray = RArray::from_value(value) | ||
| .ok_or_else(|| type_value_error_to_magnus("Expected an array of strings"))?; | ||
|
|
||
| for value in rarray.into_iter().flat_map(RString::from_value) { | ||
| map.insert(value.to_bytes()); | ||
| } | ||
|
|
Comment on lines
147
to
153
| @@ -152,7 +153,6 @@ impl Builder { | |||
| } | |||
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.
No description provided.