aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/http
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/api/http')
-rw-r--r--swarm/api/http/server.go2
-rw-r--r--swarm/api/http/server_test.go5
2 files changed, 5 insertions, 2 deletions
diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go
index 803b78987..3c6735a73 100644
--- a/swarm/api/http/server.go
+++ b/swarm/api/http/server.go
@@ -366,7 +366,7 @@ func (s *Server) handleMultipartUpload(r *http.Request, boundary string, mw *api
}
var size int64
- var reader io.Reader = part
+ var reader io.Reader
if contentLength := part.Header.Get("Content-Length"); contentLength != "" {
size, err = strconv.ParseInt(contentLength, 10, 64)
if err != nil {
diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go
index 159c8a159..04d0e045a 100644
--- a/swarm/api/http/server_test.go
+++ b/swarm/api/http/server_test.go
@@ -263,7 +263,7 @@ func TestBzzFeed(t *testing.T) {
if resp.StatusCode == http.StatusOK {
t.Fatal("Expected error status since feed update does not contain multihash. Received 200 OK")
}
- b, err = ioutil.ReadAll(resp.Body)
+ _, err = ioutil.ReadAll(resp.Body)
if err != nil {
t.Fatal(err)
}
@@ -491,6 +491,9 @@ func testBzzGetPath(encrypted bool, t *testing.T) {
}
defer resp.Body.Close()
respbody, err = ioutil.ReadAll(resp.Body)
+ if err != nil {
+ t.Fatalf("Error while reading response body: %v", err)
+ }
if string(respbody) != testmanifest[v] {
isexpectedfailrequest := false