Skip to content

Commit

Permalink
Make sure event body is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
RaeesBhatti committed Mar 19, 2018
1 parent 393787c commit 138ed1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions router/router.go
Expand Up @@ -236,6 +236,9 @@ func (router *Router) handleHTTPEvent(event *eventpkg.Event, w http.ResponseWrit
handler := func(w http.ResponseWriter, r *http.Request) {
httpdata := event.Data.(*eventpkg.HTTPEvent)
httpdata.Params = params
if byteSlice, ok := httpdata.Body.([]byte); ok {
httpdata.Body = string(byteSlice)
}
event.Data = httpdata
resp, err := router.callFunction(space, *backingFunction, *event)
if err != nil {
Expand Down

0 comments on commit 138ed1c

Please sign in to comment.