In shipping example: https://github.com/go-kit/kit/blame/master/examples/shipping/booking/transport.go#L184
encodeError may write header before setting the content-type header. From go net/http's doc:
Changing the header map after a call to WriteHeader (or Write) has no effect unless the modified headers are trailers.
Seems like the content-type header should set before the error switch.
In shipping example: https://github.com/go-kit/kit/blame/master/examples/shipping/booking/transport.go#L184
encodeErrormay write header before setting thecontent-typeheader. From go net/http's doc:Seems like the
content-typeheader should set before the error switch.