@mantiq/heartbeat 0.3.4 → 0.3.5
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
CHANGED
|
@@ -142,6 +142,7 @@ export class HeartbeatMiddleware implements Middleware {
|
|
|
142
142
|
const mem = (Math.abs(process.memoryUsage().rss - startMemory) / 1024 / 1024).toFixed(1)
|
|
143
143
|
const headers = new Headers(response!.headers)
|
|
144
144
|
headers.set('X-Heartbeat', `${Math.round(duration)}ms;${mem}MB;${response!.status};0q`)
|
|
145
|
+
headers.set('Access-Control-Expose-Headers', [headers.get('Access-Control-Expose-Headers'), 'X-Heartbeat'].filter(Boolean).join(', '))
|
|
145
146
|
response = new Response(response!.body, { status: response!.status, statusText: response!.statusText, headers })
|
|
146
147
|
} catch { /* ignore */ }
|
|
147
148
|
}
|