-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
WithHealthzEndpoint should answer with application/json Content-Type #2611
Comments
Yeah this definitely seems reasonable. Would you like to contribute this fix? |
Sure, but i don't know where to define headers. I never looked at the code of grpc-gateway. I'll be looking at |
Since we stay in the WithHealthEndpointAt() method and we use the outgoing marshaler directly in it, we can't take advantage of the Content-Type deduction (except in the errorHandler). In my opinion it is easier in this case to directly add the headers before writing the response writer. I invite you to review my PR with the proposed changes. I'm listening to your comments |
* fix: Content-Type and Grpc-Metadata-Content-Type headers with the health endpoint #2611 * fix: no need to set grpc content type header * fix: remove unnecessary grpc header comment * test: lighten the Content-Type header test
🐛 Bug Report
WithHealthzEndpoint
didn't set Content-Type to anything buttext/plain; charset=utf-8
. Shouldn't it beapplication/json
?To Reproduce
Expected behavior
Actual Behavior
Your Environment
Go 1.18 with grpc-gateway v2.10.0
Linux 5.17.0-arch1-1 #1 SMP PREEMPT Tue, 22 Mar 2022 23:36:09 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: