Content-Type Validation Missing: Requests Not Returning HTTP 415 When Content-Type Is Not Start with `application/grpc`
- Dominant language
- Rust
- Stars
- 12.5k
- Forks
- 1.3k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 24
Description
## 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](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md) 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.
Contributor guide
Assessment
This issue has not been assessed yet.