mirror of
https://github.com/foomo/sesamy-go.git
synced 2025-10-16 12:35:43 +00:00
feat: copy headers
This commit is contained in:
parent
1c4f38e552
commit
ba2d68fd99
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"strings"
|
||||
|
||||
"github.com/ThreeDotsLabs/watermill/message"
|
||||
@ -111,6 +112,10 @@ func (p *Publisher) Publish(topic string, messages ...*message.Message) error {
|
||||
|
||||
// p.l.Trace("Publishing message", logFields)
|
||||
|
||||
r, _ := httputil.DumpRequestOut(req, true)
|
||||
fmt.Println("--> Outgoing publish")
|
||||
fmt.Println(string(r))
|
||||
|
||||
resp, err := p.client.Do(req)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to publish message: %s", msg.UUID)
|
||||
|
||||
@ -137,6 +137,9 @@ func (c *Client) SendRaw(r *http.Request, event *Event) error {
|
||||
return errors.Wrap(err, "failed to create request")
|
||||
}
|
||||
|
||||
// copy headers
|
||||
req.Header = r.Header.Clone()
|
||||
|
||||
// forward cookies
|
||||
for _, cookie := range c.cookies {
|
||||
if value, _ := r.Cookie(cookie); value != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user