Skip to content
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

remove isGrpcRequest check from the java api to align with scala api #1669

Merged
merged 2 commits into from
Aug 26, 2022
Merged

remove isGrpcRequest check from the java api to align with scala api #1669

merged 2 commits into from
Aug 26, 2022

Conversation

sebastian-alfers
Copy link
Contributor

Fixes #1668 and #1574

Copy link
Member

@johanandren johanandren left a comment

Choose a reason for hiding this comment

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

LGTM

@johanandren
Copy link
Member

(but let's wait to see what @raboof thinks before merging)

Copy link
Member

@raboof raboof left a comment

Choose a reason for hiding this comment

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

Indeed looks more consistent AFAICS. Would be nice to have more test coverage of the expected behavior in this area, to make sure this 'stays fixed', but if you have tested this for the scenario you care about I'm OK with merging as-is too.

@@ -50,7 +49,7 @@ object ServiceHandler {
def handler(handlers: JFunction[HttpRequest, CompletionStage[HttpResponse]]*)
: JFunction[HttpRequest, CompletionStage[HttpResponse]] = {
val servicesHandler = concat(handlers: _*)
(req: HttpRequest) => if (sServiceHandler.isGrpcRequest(req)) servicesHandler(req) else unsupportedMediaType
(req: HttpRequest) => servicesHandler(req)
Copy link
Member

Choose a reason for hiding this comment

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

The comment says "If the request is for an invalid media type, then a 415: Unsupported Media Type response is produced.". This probably only is true for paths matched by the handler? Might be something to double-check and perhaps make the comment more specific?

Copy link
Contributor Author

@sebastian-alfers sebastian-alfers Aug 26, 2022

Choose a reason for hiding this comment

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

Good point, I changed the comment.

@raboof raboof merged commit d125b95 into akka:main Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

grpc-web not working for java api
3 participants