diff --git a/transport/http_transport.go b/transport/http_transport.go index e6fd1b05..c9878073 100644 --- a/transport/http_transport.go +++ b/transport/http_transport.go @@ -316,6 +316,10 @@ func (h *httpTransportSocket) Send(m *Message) error { // no op } + // we need to lock to protect the write + h.mtx.RLock() + defer h.mtx.RUnlock() + // set headers for k, v := range m.Header { h.w.Header().Set(k, v)