summaryrefslogtreecommitdiff
path: root/pkg/worker_handler
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/worker_handler')
-rw-r--r--pkg/worker_handler/request.go8
-rw-r--r--pkg/worker_handler/response.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/worker_handler/request.go b/pkg/worker_handler/request.go
index 44c466bb..3d60897b 100644
--- a/pkg/worker_handler/request.go
+++ b/pkg/worker_handler/request.go
@@ -138,18 +138,18 @@ func (r *Request) Close(log logger.Logger) {
// Payload request marshaled RoadRunner payload based on PSR7 data. values encode method is JSON. Make sure to open
// files prior to calling this method.
-func (r *Request) Payload() (payload.Payload, error) {
+func (r *Request) Payload() (*payload.Payload, error) {
const op = errors.Op("marshal_payload")
- p := payload.Payload{}
+ p := &payload.Payload{}
var err error
if p.Context, err = json.Marshal(r); err != nil {
- return payload.Payload{}, errors.E(op, errors.Encode, err)
+ return nil, errors.E(op, errors.Encode, err)
}
if r.Parsed {
if p.Body, err = json.Marshal(r.body); err != nil {
- return payload.Payload{}, errors.E(op, errors.Encode, err)
+ return nil, errors.E(op, errors.Encode, err)
}
} else if r.body != nil {
p.Body = r.body.([]byte)
diff --git a/pkg/worker_handler/response.go b/pkg/worker_handler/response.go
index cbf22794..d22f09d4 100644
--- a/pkg/worker_handler/response.go
+++ b/pkg/worker_handler/response.go
@@ -22,7 +22,7 @@ type Response struct {
}
// NewResponse creates new response based on given pool payload.
-func NewResponse(p payload.Payload) (*Response, error) {
+func NewResponse(p *payload.Payload) (*Response, error) {
const op = errors.Op("http_response")
r := &Response{Body: p.Body}
if err := json.Unmarshal(p.Context, r); err != nil {