Skip to content

Commit a338b9a

Browse files
committed
Merge branch 'main' into health-endpoint
2 parents 3b1a31c + fe8fdaf commit a338b9a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

proxy/proxy.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ func NewProxyServer() (*ProxyServer, error) {
3636
ps := &ProxyServer{
3737
runtimeEndpoint: os.Getenv("AWS_LAMBDA_RUNTIME_API"),
3838
port: port,
39-
eventsChannel: make(chan *http.Response),
40-
lambdaResponseChannel: make(chan *http.Request),
41-
RecordsChannel: make(chan firetail.Record),
39+
eventsChannel: make(chan *http.Response, 1),
40+
lambdaResponseChannel: make(chan *http.Request, 1),
41+
RecordsChannel: make(chan firetail.Record, 100),
4242
}
4343

4444
r := chi.NewRouter()

proxy/proxy_handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package proxy
22

33
import (
44
"io"
5+
"log"
56
"net/http"
67
"net/url"
78
"strings"
@@ -34,6 +35,7 @@ func getProxyHandler(urlMappingFunc func(r *http.Request) (*url.URL, error), req
3435

3536
// Send the request to the requestChannel with the copied body if the channel was provided
3637
if requestChannel != nil {
38+
log.Println("Captured lambda response", requestBodyCopy.String())
3739
r.Body = io.NopCloser(strings.NewReader(requestBodyCopy.String()))
3840
*requestChannel <- r
3941
}
@@ -57,6 +59,7 @@ func getProxyHandler(urlMappingFunc func(r *http.Request) (*url.URL, error), req
5759

5860
// Send the response to the responseChannel with the copied body if the channel was provided
5961
if responseChannel != nil {
62+
log.Println("Captured event", responseBodyCopy.String())
6063
resp.Body = io.NopCloser(strings.NewReader(responseBodyCopy.String()))
6164
*responseChannel <- resp
6265
}

0 commit comments

Comments
 (0)