Skip to content

Commit 9da1e9f

Browse files
chfritzchris-smith
authored andcommitted
Small bug fix for constants in on-the-fly message classes (#33)
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.
1 parent ee5b7b1 commit 9da1e9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils/messages.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ function calculateMD5(details, type) {
272272
function getMD5text(part) {
273273
var message = '';
274274
var constants = part.constants.map(function(field) {
275-
return field.type + ' ' + field.name + '=' + field.value;
275+
return field.type + ' ' + field.name + '=' + field.raw;
276276
}).join('\n');
277277

278278
var fields = part.fields.map(function(field) {
@@ -348,6 +348,7 @@ function extractFields(content, details, callback) {
348348
name : fieldName
349349
, type : fieldType
350350
, value : parsedConstant
351+
, raw : constant
351352
, index : fields.length
352353
, messageType : null
353354
});

0 commit comments

Comments
 (0)