Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func main() {
req.CallbackURL.String(),
xCallID,
status,
req.Function,
timeTaken)

if resultErr != nil {
Expand Down Expand Up @@ -166,6 +167,7 @@ func main() {
req.CallbackURL.String(),
xCallID,
res.StatusCode,
req.Function,
timeTaken)

if resultErr != nil {
Expand Down Expand Up @@ -258,7 +260,8 @@ func makeClient() http.Client {
return proxyClient
}

func postResult(client *http.Client, functionRes *http.Response, result []byte, callbackURL string, xCallID string, statusCode int, timeTaken float64) (int, error) {
func postResult(client *http.Client, functionRes *http.Response, result []byte, callbackURL string, xCallID string,
statusCode int, functionName string, timeTaken float64) (int, error) {
var reader io.Reader

if functionRes.Header.Get("X-Duration-Seconds") == "" {
Expand All @@ -280,6 +283,7 @@ func postResult(client *http.Client, functionRes *http.Response, result []byte,
}

request.Header.Set("X-Function-Status", fmt.Sprintf("%d", statusCode))
request.Header.Set("X-Function-Name", functionName)

if len(xCallID) > 0 {
request.Header.Set("X-Call-Id", xCallID)
Expand Down