tonic
tonic copied to clipboard
Content-Type Validation Missing: Requests Not Returning HTTP 415 When Content-Type Is Not Start with `application/grpc`
Bug Report
Version
master branch
Crates
tonic
tonic-build
Description
When receiving a request with a content-type that does not start with application/grpc, the tonic library does not return HTTP status of 415. According to the gRPC documentation, if the content-type does not start with application/grpc, an HTTP status code 415 should be returned.
I believe this issue could be resolved by adding a check for the content-type in the code generated by tonic-build. I am willing to submit a PR to address this issue if needed. Thank you for considering this enhancement to the tonic library.