-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix HttpResponse error #1620
Fix HttpResponse error #1620
Conversation
@@ -1146,13 +1146,13 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, Socket *socket, | |||
return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA); | |||
} | |||
// Send 400 back. | |||
butil::IOBuf bad_req; | |||
butil::IOBuf bad_resp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name should be bad_req, which indicates that the response content is 'Bad Request', rather than a 'bad' response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then a simple resp
maybe better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wasphin I have modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a member.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed
@@ -1146,13 +1146,13 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, Socket *socket, | |||
return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA); | |||
} | |||
// Send 400 back. | |||
butil::IOBuf bad_req; | |||
butil::IOBuf bad_resp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wasphin I have modified.
Merged, thanks for your contribution. |
When an incorrect HTTP request is received, the existing code returns an
HttpRequest
, which should actually return anHttpResponse
.before fixing:
After modification: