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.