tonic icon indicating copy to clipboard operation
tonic copied to clipboard

Content-Type Validation Missing: Requests Not Returning HTTP 415 When Content-Type Is Not Start with `application/grpc`

Open YHM404 opened this issue 8 months ago • 0 comments

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.

YHM404 avatar Jun 05 '24 16:06 YHM404