murmur8 4.7.7 → 4.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/telemetry.js +4 -2
package/package.json
CHANGED
package/src/telemetry.js
CHANGED
|
@@ -168,7 +168,9 @@ function sendTelemetry(payload, config) {
|
|
|
168
168
|
if (!url) return Promise.resolve();
|
|
169
169
|
|
|
170
170
|
return new Promise((resolve) => {
|
|
171
|
-
|
|
171
|
+
// Portal expects flat fields — unwrap the { runId, run } envelope if present
|
|
172
|
+
const data = (payload && payload.run) ? payload.run : payload;
|
|
173
|
+
const body = JSON.stringify(data);
|
|
172
174
|
const parsedUrl = new URL(url);
|
|
173
175
|
const isHttps = parsedUrl.protocol === 'https:';
|
|
174
176
|
const transport = isHttps ? require('https') : require('http');
|
|
@@ -181,7 +183,7 @@ function sendTelemetry(payload, config) {
|
|
|
181
183
|
headers: {
|
|
182
184
|
'Content-Type': 'application/json',
|
|
183
185
|
'Content-Length': Buffer.byteLength(body),
|
|
184
|
-
'
|
|
186
|
+
'Authorization': `Bearer ${key || ''}`,
|
|
185
187
|
},
|
|
186
188
|
};
|
|
187
189
|
|