Skip to content

Commit

Permalink
fix: add missing data from http request (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
davemooreuws authored Jun 28, 2024
1 parent b893772 commit 74ce2f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions handler/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func NewHttpContext(msg *http.ServerMessage) *HttpContext {
pathParams: req.PathParams,
query: query,
headers: headers,
data: req.Body,
},
Response: &HttpResponse{
Status: 200,
Expand Down
6 changes: 6 additions & 0 deletions handler/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
type HttpRequest interface {
Method() string
Path() string
Data() []byte
Query() map[string][]string
Headers() map[string][]string
PathParams() map[string]string
Expand All @@ -32,6 +33,7 @@ type HttpRequest interface {
type httpRequestImpl struct {
method string
path string
data []byte
query map[string][]string
headers map[string][]string
pathParams map[string]string
Expand All @@ -45,6 +47,10 @@ func (h *httpRequestImpl) Path() string {
return h.path
}

func (h *httpRequestImpl) Data() []byte {
return h.data
}

func (h *httpRequestImpl) Query() map[string][]string {
return h.query
}
Expand Down

0 comments on commit 74ce2f3

Please sign in to comment.