Skip to content

Commit 6d0b954

Browse files
committed
Add custom headers at the start of the SSE client
1 parent a0e968a commit 6d0b954

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

client/sse.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ func (c *SSEMCPClient) Start(ctx context.Context) error {
9494
req.Header.Set("Cache-Control", "no-cache")
9595
req.Header.Set("Connection", "keep-alive")
9696

97+
// set custom http headers
98+
for k, v := range c.headers {
99+
req.Header.Set(k, v)
100+
}
101+
97102
resp, err := c.httpClient.Do(req)
98103
if err != nil {
99104
return fmt.Errorf("failed to connect to SSE stream: %w", err)

0 commit comments

Comments
 (0)