Skip to content

Commit d4fdfb8

Browse files
committed
Added content-length header
1 parent 8c2e18b commit d4fdfb8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ coverage.txt
77
/hookdeck-linux
88
/hookdeck-windows.exe
99
default_cassette.yaml
10+
.vscode/
11+
__debug_bin

pkg/proxy/proxy.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,17 @@ func (p *Proxy) processAttempt(msg websocket.IncomingMessage) {
233233
}
234234
}
235235
}
236-
236+
237237
if bodyIsText {
238238
req.Body = ioutil.NopCloser(strings.NewReader(webhookEvent.Body.Request.DataString))
239+
req.ContentLength = int64(len(webhookEvent.Body.Request.DataString))
239240
} else {
240241
req.Body = io.NopCloser(bytes.NewBuffer(webhookEvent.Body.Request.Data))
242+
req.ContentLength = int64(len(webhookEvent.Body.Request.Data))
241243
}
242244

243245
res, err := client.Do(req)
246+
244247
if err != nil {
245248
color := ansi.Color(os.Stdout)
246249
localTime := time.Now().Format(timeLayout)

0 commit comments

Comments
 (0)