iotblackbelt / noderededgemodule

This repo contains the documentation for Azure IoT Edge module to use node-red on IoT Edge.
MIT License
23 stars 19 forks source link

module don't take over contentType/-Encoding from original message #10

Open dekadenns opened 3 years ago

dekadenns commented 3 years ago

just noticed that the output node don't take over contentType and contentEncoding parameters from the original msg.

    message.contentType = "application/json";
    message.contentEncoding = "utf-8";

If e.g. this is set on the leafdevice, the node module ignore these settings and on IoT Hub the message is recieved with base64 encoded Body.

fixed this issue for me by adding these settings to sendMessageToEdgeHub function in azureiotedge.js, but maybe it would be useful, if theses seetings would be taken over from the original message.

I've used container image which is provided through the marketplace (marketplace.azurecr.io/1604376875527/wedx-nodered) Version of the module is 1.0.4

Kind regards

basettoni89 commented 2 years ago

The pull request #17, partially address this issue defining contentType and contentEncoding as shown.