Refactor Read function in malformed_host_override.go#39046
Closed
withlin wants to merge 3 commits intomoby:masterfrom
withlin:if
Closed
Refactor Read function in malformed_host_override.go#39046withlin wants to merge 3 commits intomoby:masterfrom withlin:if
withlin wants to merge 3 commits intomoby:masterfrom
withlin:if
Conversation
Signed-off-by: Fu JinLin <withlin@yeah.net>
Signed-off-by: Fu JinLin <withlin@yeah.net>
thaJeztah
requested changes
Apr 10, 2019
| continue | ||
| } | ||
| if b[i+7] != '/' { | ||
| if b[i+1] != 'H' || b[i+2] != 'o' || b[i+3] != 's' || |
Member
There was a problem hiding this comment.
Although it's more compact, I don't think this makes it more readable than the existing code. Perhaps something like this would work;
Suggested change
| if b[i+1] != 'H' || b[i+2] != 'o' || b[i+3] != 's' || | |
| if string(b[i:i+8]) != "\nHost: /" { |
edit; fix off-by-one (last should be i+8, not i+7)
Signed-off-by: Fu JinLin <withlin@yeah.net>
Codecov Report
@@ Coverage Diff @@
## master #39046 +/- ##
=========================================
Coverage ? 36.91%
=========================================
Files ? 612
Lines ? 45327
Branches ? 0
=========================================
Hits ? 16732
Misses ? 26308
Partials ? 2287 |
Member
|
Thank you for updating! The changes LGTM 🤗 However, after some discussion on #38928 (comment), we decided to remove this hack entirely (see #39076). For that reason, I'll have to close this PR. Thank you so much for contributing! Even though this PR won't be merged, it's really appreciated! |
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.
Signed-off-by: Fu JinLin withlin@yeah.net
Refactor the Read function.
Reduce the number of ifs used