diff --git a/README.md b/README.md index 3ef3fd0..71dabde 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,7 @@ the data block is base64 encoded. - `path` - `string` - request path - `method` - `string` - request method - `headers` - `object` - request headers +- `host` - `string` - request host - `query` - `object` - query parameters - `params` - `object` - matched path parameters - `body` - depends on `Content-Type` header - request payload diff --git a/event/http.go b/event/http.go index 264ca93..d049d72 100644 --- a/event/http.go +++ b/event/http.go @@ -5,6 +5,7 @@ type HTTPEvent struct { Headers map[string][]string `json:"headers"` Query map[string][]string `json:"query"` Body interface{} `json:"body"` + Host string `json:"host"` Path string `json:"path"` Method string `json:"method"` Params map[string]string `json:"params"` diff --git a/router/router.go b/router/router.go index b8031f3..9991d9d 100644 --- a/router/router.go +++ b/router/router.go @@ -222,6 +222,7 @@ func (router *Router) eventFromRequest(r *http.Request) (*eventpkg.Event, error) Headers: r.Header, Query: r.URL.Query(), Body: event.Data, + Host: r.Host, Path: r.URL.Path, Method: r.Method, }