gRPC content-type header cannot be set using the go grpc library

Hi, I've been trying to setup a gRPC server behind a cloudflare proxy. The documentation states that I need to set a content-type header in my gRPC request and I've been trying to do that, but no luck. I've followed a guide (https://www.inanzzz.com/index.php/post/7l4u/sending-and-receiving-grpc-client-server-headers-in-golang) and the documentation (https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md), but still the content-type header refuses to send with my message. Because the content-type header is missing, CF is rejecting my request:
403 (Forbidden); malformed header: missing HTTP content-type
Is there some other way I can set the content-type header in the Go client? I would expect this to be a solved problem already but I am struggling to find anything about it online. Thanks!
inanzzz | Sending and receiving gRPC client server headers in Golang
Sending and receiving gRPC client server headers in Golang
3 Replies
parapenguin.
parapenguin.OP16mo ago
Also getting the same result when I use grpcurl, which is also written in Go
Cyb3r-Jak3
Cyb3r-Jak316mo ago
Do you have gRPC connections turned on https://dash.cloudflare.com/?to=/:account/:zone/network
parapenguin.
parapenguin.OP16mo ago
yes, I've tried it on 2 domains and get the same behaviour on both. It's the same with both off & on, have waited 12 hours after turning it on

Did you find this page helpful?