Skip to content

Commit 7a0175a

Browse files
minor fixes
1 parent 8b01347 commit 7a0175a

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, yevhenii/proxy-fixes ]
66
pull_request:
77
branches: [ main ]
88

cmd/boundary/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,24 @@ package main
22

33
import (
44
"fmt"
5+
"log"
56
"os"
67

78
"github.com/coder/boundary/cli"
89
)
910

11+
import (
12+
"net/http"
13+
_ "net/http/pprof"
14+
)
15+
16+
func init() {
17+
go func() {
18+
log.Println("pprof listening on :6060")
19+
log.Println(http.ListenAndServe("0.0.0.0:6060", nil))
20+
}()
21+
}
22+
1023
// Version information injected at build time
1124
var (
1225
//nolint:unused

proxy/proxy.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ func (p *Server) forwardRequest(conn net.Conn, req *http.Request, https bool) {
270270
Path: req.URL.Path,
271271
RawQuery: req.URL.RawQuery,
272272
}
273-
newReq, err := http.NewRequest(req.Method, targetURL.String(), nil)
273+
var body io.ReadCloser = req.Body
274+
if req.Method == http.MethodGet || req.Method == http.MethodHead {
275+
body = nil
276+
}
277+
newReq, err := http.NewRequest(req.Method, targetURL.String(), body)
274278
if err != nil {
275279
p.logger.Error("can't create http request", "error", err)
276280
return

0 commit comments

Comments
 (0)