From 96c37f5f2239d89c6474f43f56234f86215f72a1 Mon Sep 17 00:00:00 2001 From: Christian Fritz Date: Thu, 13 Oct 2016 21:58:55 -0700 Subject: [PATCH] Small bug fix for constants in on-the-fly message classes Prior to this commit constant values like "1.0", i.e., floats that are integer, were not correctly treated in the md5sum calculation -- they were abbreviated to "1", causing incorrect md5sums. This commit fixes that by using the original string value for md5sum calculation. --- utils/messages.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/messages.js b/utils/messages.js index 4fefcc0..10229c2 100644 --- a/utils/messages.js +++ b/utils/messages.js @@ -272,7 +272,7 @@ function calculateMD5(details, type) { function getMD5text(part) { var message = ''; var constants = part.constants.map(function(field) { - return field.type + ' ' + field.name + '=' + field.value; + return field.type + ' ' + field.name + '=' + field.raw; }).join('\n'); var fields = part.fields.map(function(field) { @@ -348,6 +348,7 @@ function extractFields(content, details, callback) { name : fieldName , type : fieldType , value : parsedConstant + , raw : constant , index : fields.length , messageType : null });