Store the status exactly once on the HTTPRedirect#1615
Merged
Conversation
…er be set after the initial construction.
77ef858 to
3e24195
Compare
webknjaz
approved these changes
Aug 29, 2017
Codecov Report
@@ Coverage Diff @@
## master #1615 +/- ##
==========================================
+ Coverage 76.7% 76.94% +0.24%
==========================================
Files 106 106
Lines 14280 14374 +94
==========================================
+ Hits 10953 11060 +107
+ Misses 3327 3314 -13
Continue to review full report at Codecov.
|
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.
While reviewing #1611, I noticed that the 'status' of an HTTPRedirect is stored in two places on the class, once in the
Exception.argsand again in theHTTPRedirect.status. This approach is sloppy, and could lead to situations where the two values don't match. Better would be to either store the value in the args and refer to it when referencing the status (as proposed here) or to only store it in the status property. I feel like this proposed change is less invasive than removing the status from the args.One backward-incompatible effect this proposal introduces is that the status can no longer be set after the redirect is constructed:
Previously, that would have worked but no longer will. I suggest this usage was never supported (not captured in tests) and so may be changed without formally introducing a backward-incompatibility.
I don't feel strongly about one approach or another, but I do feel strongly that this status should be stored exactly once.