diff options
author | Wolfy-J <[email protected]> | 2018-06-10 17:04:02 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-10 17:04:02 +0300 |
commit | 3fe85e9d92f5f98337e8f7fd9a14e6b66b9694bd (patch) | |
tree | 2575fbba16df4f95dd392f231ad7d7b30a5dd4ef /service/http/request.go | |
parent | 4c292ee46f5505b00b16186e8f30e9bc1be25895 (diff) |
http service
Diffstat (limited to 'service/http/request.go')
-rw-r--r-- | service/http/request.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/service/http/request.go b/service/http/request.go index fd483744..c7304c8d 100644 --- a/service/http/request.go +++ b/service/http/request.go @@ -44,7 +44,7 @@ type Request struct { } // NewRequest creates new PSR7 compatible request using net/http request. -func NewRequest(r *http.Request) (req *Request, err error) { +func NewRequest(r *http.Request, cfg *UploadsConfig) (req *Request, err error) { req = &Request{ Protocol: r.Proto, Method: r.Method, @@ -67,11 +67,11 @@ func NewRequest(r *http.Request) (req *Request, err error) { return nil, err } - if req.body, err = parsePost(r); err != nil { + if req.body, err = parseData(r); err != nil { return nil, err } - if req.Uploads, err = parseUploads(r); err != nil { + if req.Uploads, err = parseUploads(r, cfg); err != nil { return nil, err } @@ -80,12 +80,12 @@ func NewRequest(r *http.Request) (req *Request, err error) { } // Open moves all uploaded files to temporary directory so it can be given to php later. -func (r *Request) Open(cfg *Config) error { +func (r *Request) Open() error { if r.Uploads == nil { return nil } - return r.Uploads.Open(cfg) + return r.Uploads.Open() } // Close clears all temp file uploads |