test: fix dockerproxy test

This commit is contained in:
Girish Ramakrishnan
2025-06-06 18:07:03 +02:00
parent dffa3b7986
commit 4ffff84540
2 changed files with 2 additions and 2 deletions

View File

@@ -104,7 +104,7 @@ async function containersCreate(req, res, next) {
// eslint-disable-next-line no-unused-vars
function process(req, res, next) {
// we have to rebuild the body since we consumed in in the parser
if (Object.keys(req.body).length !== 0) {
if (req.body && Object.keys(req.body).length !== 0) {
const plainBody = JSON.stringify(req.body);
req.dockerRequest.setHeader('Content-Length', Buffer.byteLength(plainBody));
req.dockerRequest.end(plainBody);