diff --git a/src/dockerproxy.js b/src/dockerproxy.js index b7c636a74..e1db0005b 100644 --- a/src/dockerproxy.js +++ b/src/dockerproxy.js @@ -98,7 +98,12 @@ function containersCreate(req, res, next) { } function process(req, res, next) { - if (!req.readable) { + // we have to rebuild the body since we consumed in in the parser + if (req.body) { + let plainBody = JSON.stringify(req.body); + req.dockerRequest.setHeader('Content-Length', Buffer.byteLength(plainBody)); + req.dockerRequest.end(plainBody); + } else if (!req.readable) { req.dockerRequest.end(); } else { req.pipe(req.dockerRequest, { end: true });