|
@@ -2,11 +2,14 @@ package volume
|
|
|
|
|
|
import (
|
|
import (
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
|
+ "errors"
|
|
|
|
+ "io"
|
|
"net/http"
|
|
"net/http"
|
|
|
|
|
|
"github.com/docker/docker/api/server/httputils"
|
|
"github.com/docker/docker/api/server/httputils"
|
|
"github.com/docker/docker/api/types/filters"
|
|
"github.com/docker/docker/api/types/filters"
|
|
volumetypes "github.com/docker/docker/api/types/volume"
|
|
volumetypes "github.com/docker/docker/api/types/volume"
|
|
|
|
+ "github.com/docker/docker/errdefs"
|
|
"golang.org/x/net/context"
|
|
"golang.org/x/net/context"
|
|
)
|
|
)
|
|
|
|
|
|
@@ -45,6 +48,9 @@ func (v *volumeRouter) postVolumesCreate(ctx context.Context, w http.ResponseWri
|
|
|
|
|
|
var req volumetypes.VolumesCreateBody
|
|
var req volumetypes.VolumesCreateBody
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
|
|
+ if err == io.EOF {
|
|
|
|
+ return errdefs.InvalidParameter(errors.New("got EOF while reading request body"))
|
|
|
|
+ }
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|