TritonDataCenter / node-triton

Triton client tool and node.js library
57 stars 39 forks source link

BadDigestError: Content-MD5 when body has non-ascii characters #332

Closed Adel-Magebinary closed 1 year ago

Adel-Magebinary commented 1 year ago

Hey guys,

The latest triton-cli is throwing BadDigestError: Content-MD5.

triton instance list: error (BadDigest): BadDigestError: Content-MD5 at IncomingMessage.finish (/usr/local/lib/node_modules/triton/lib/SaferJsonClient.js:134:26) at Object.onceWrapper (events.js:420:28) at IncomingMessage.emit (events.js:326:22) at endReadableNT (_stream_readable.js:1241:12) at processTicksAndRejections (internal/process/task_queues.js:84:21)

Adel-Magebinary commented 1 year ago

The issue comes from /usr/local/lib/node_modules/triton/lib/SaferJsonClient.js


            // Content-MD5 check.
            if (contentMd5Hash &&
                contentMd5 !== contentMd5Hash.digest('base64'))
            {
                resErr = new errors.BadDigestError('Content-MD5');
                callback(resErr, req, res);
                return;
            }
travispaul commented 1 year ago

Hi @Adel-Magebinary,

Thanks for the report. We may have a fix queued up for this issue and could use some details about your environment to confirm you're hitting the same issue. I sent you a private mail in case you could provide some additional details.

bahamat commented 1 year ago

Hi @Adel-Magebinary. Version 7.15.4 has been published to NPM, which should resolve your issue. Sorry this took so long, I wanted to make sure we had thorough regression testing.

Adel-Magebinary commented 1 year ago

Thank you so much for the hard work!