summaryrefslogtreecommitdiff
path: root/service/http/request.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 17:04:02 +0300
committerWolfy-J <[email protected]>2018-06-10 17:04:02 +0300
commit3fe85e9d92f5f98337e8f7fd9a14e6b66b9694bd (patch)
tree2575fbba16df4f95dd392f231ad7d7b30a5dd4ef /service/http/request.go
parent4c292ee46f5505b00b16186e8f30e9bc1be25895 (diff)
http service
Diffstat (limited to 'service/http/request.go')
-rw-r--r--service/http/request.go10
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