Skip to content

Commit

Permalink
add host field in HTTP event. Closes #327
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Winnicki committed Oct 25, 2017
1 parent 6a4e3cc commit b5fbcbc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions event/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
1 change: 1 addition & 0 deletions router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit b5fbcbc

Please sign in to comment.