-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a setlist method to the Headers datastructure
The update method added in baa7bdc is meant to replace headers with the mapping passed in. If a MultDict or Headers object is passed in it would replace headers with the final iterated value, rather than all the values iterated over. This could lead to unexpected results, therefore this corrects the functionality to what I think is expected. Consider, h1 = Headers() h1.add("X-Multi", "value") h2 = Headers() h2.add("X-Multi", "newValue") h2.add("X-Multi", "alternativeValue") h1.update(h2) previously `h1.getlist("X-Multi")` would likely equal `["alternativeValue"]` whereas now it equals `["newValue", "alternativeValue"]` which is as you'd expect.
- Loading branch information
Showing
2 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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