-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Netty server poorly handles unknown content type #3370
Comments
I was about to open an issue about this. I want a grpc-java server to serve a grpc-web client. I want to write a wrapper the same way as in grpc-web wrapper.go So I think the only way to add it, is to expose the netty pipeline and add a codec that transforms requests and responses between grpc and grpc-web. If there is another way to do it please let me know. |
@lbensaad, your problem seems unrelated. Note that the older HTTP/2 API in Netty that gRPC is using doesn't let you "add a codec that transforms": it's monolithic and avoids the pipeline. gRPC needs to migrate to "h2childchan": netty/netty#3667 |
Thanks @ejona86. |
@lbensaad, I feel like we had an issue for that already, but I can't find it. Yeah, open up a new issue. |
@ejona86 are you actively working on this? |
On a recent plane flight I messed with it some in https://github.com/ejona86/grpc-java/tree/dont-misuse-refused . But I've not had time to circle back to it. I'd be fine if you wanted to pick it up (as it stands, I'll have to re-discover what my TODOs and FIXMEs mean 😄). |
@ejona86 I looked at it and could not find what you meant by couple of TODOs though. Otherwise the implementation looks fine. |
FIXME: ejona86@ad93041#diff-dde99a3f12e631de9f1605b24abd9c2bR371 I'm pretty sure that some tests fail. I think the FIXME is because the HTTP code is wrong. There's probably a need for some added tests. |
@ejona86 I got your code and built the complete thing.
As expected, the contentType test |
@ramaraochavali The last TODO was to see if To check if you need more tests, you can run |
Fixed by #3735 |
If the content-type is missing or unknown, the Netty transport sends RST_STREAM with REFUSED_STREAM. That's bonkers on multiple levels.
We should probably respond with HTTP 415 instead.
The text was updated successfully, but these errors were encountered: