From 7ac1ee9166eaca9f24552f02cc5cee06ae585e20 Mon Sep 17 00:00:00 2001 From: Joost Vunderink Date: Sun, 29 Oct 2017 15:25:58 +0100 Subject: [PATCH] Now passing the x-iota-api-version header --- lib/iotaproxy.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/iotaproxy.js b/lib/iotaproxy.js index 511e377..6f7f385 100644 --- a/lib/iotaproxy.js +++ b/lib/iotaproxy.js @@ -114,6 +114,15 @@ let iotaProxy = 'Content-Type': request.headers['content-type'], 'Content-Length': requestbody.length }; + // Make sure the x-iota-api-version header is also passed along, + // no matter the casing used for this header. + Object.keys(request.headers).forEach(function(key) + { + if (key.toLowerCase() === 'x-iota-api-version') + { + proxyRequestOptions.headers[key] = request.headers[key]; + } + }); } let proxyRequest = http.request(