Add setheader!, appendheader! and removeheader! aliases - #1359
Open
quinnj wants to merge 1 commit into
Open
Conversation
`setheader`, `appendheader` and `removeheader` all mutate their first argument but lack the conventional `!` suffix, which misleads readers into expecting copies (#1277). Add the `!` spellings as the same function objects (so extending either name extends both), keep the historical names undeprecated, mark all six `public`, and cross-link the docstrings. Closes #1277 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1359 +/- ##
==========================================
+ Coverage 89.42% 89.51% +0.08%
==========================================
Files 31 31
Lines 12594 12594
==========================================
+ Hits 11262 11273 +11
+ Misses 1332 1321 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Closes #1277.
Problem
setheader,appendheaderandremoveheadermutate their first argument but carry no!, so readers expect them to return copies. The thread on #1277 settled on adding the!spellings without deprecating the historical names, since those also existed in 1.x.Change
setheader!,appendheader!andremoveheader!are defined asconstaliases of the existing functions, so each pair is the same function object: every existing method (both theHeadersand theRequest/Responseforms) is reachable under either name, and a package extending one name extends the other.!spelling as the preferred form.publicalongside the old ones and are listed on the core API docs page.Tests
Mutating-name header aliases (#1277)intest/http_core_tests.jlchecks identity of the aliases, theHeadersand message-level forms (including the comma-merge behavior ofappendheader!and case-insensitiveremoveheader!), and that the names arepublicon Julia 1.11+.test/http_core_tests.jlpasses in full locally on Julia 1.12.6.🤖 Generated with Claude Code