Skip to content

Conversation

@ramaraochavali
Copy link
Contributor

@ramaraochavali ramaraochavali commented Nov 14, 2017

PR for #3370

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 14, 2017
@kokoro-team kokoro-team removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 14, 2017
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Just one easy change. Thanks!

// Remove the leading slash of the path and get the fully qualified method name
CharSequence path = headers.path();
if (path.charAt(0) != '/') {
respondWithHttpError(ctx, streamId, 404, Status.Code.UNIMPLEMENTED,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 404 case should be first. If both content-type and path are wrong, we should respond with 404.

@ramaraochavali
Copy link
Contributor Author

moved the path check up to return 404 early. Added explicit path==null to give a better message otherwise we could have combined both.

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 15, 2017
@kokoro-team kokoro-team removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 15, 2017
@ejona86 ejona86 requested a review from zpencer November 15, 2017 17:01
return;
}

String method = path.subSequence(1, path.length()).toString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: path.substring()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path is a CharSequence, so it doesn't have substring.

String method = path.subSequence(1, path.length()).toString();

// Verify that the Content-Type is correct in the request.
verifyContentType(streamId, headers);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I didn't delete these methods. They're now unused: determineMethod, verifyContentType

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and deleted them, since it was trivial.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ejona86 great..thanks..I should have done it my self. Did not pay attention. Sorry :-)

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 15, 2017
@kokoro-team kokoro-team removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Nov 15, 2017
@ejona86 ejona86 merged commit df357cb into grpc:master Nov 15, 2017
@ejona86
Copy link
Member

ejona86 commented Nov 15, 2017

@ramaraochavali, thank you!

@ejona86 ejona86 added the TODO:backport PR needs to be backported. Removed after backport complete label Nov 15, 2017
@ejona86 ejona86 removed the TODO:backport PR needs to be backported. Removed after backport complete label Nov 17, 2017
@carl-mastrangelo carl-mastrangelo added this to the 1.9 milestone Nov 30, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants