backend-manager 3.2.11 → 3.2.12
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
|
@@ -495,14 +495,24 @@ function _attachHeaderProperties(self, options, error) {
|
|
|
495
495
|
},
|
|
496
496
|
additional: options.additional || {},
|
|
497
497
|
}
|
|
498
|
+
const req = self.ref.req;
|
|
499
|
+
const res = self.ref.res;
|
|
498
500
|
|
|
499
501
|
// Attach properties
|
|
500
502
|
try {
|
|
501
|
-
|
|
503
|
+
res.header('bm-properties', JSON.stringify(headers));
|
|
502
504
|
} catch (e) {
|
|
503
505
|
self.warn('Error attaching properties to header', e);
|
|
504
506
|
}
|
|
505
507
|
|
|
508
|
+
// Add bm-properties to Access-Control-Expose-Headers
|
|
509
|
+
const existingExposed = res.get('Access-Control-Expose-Headers') || '';
|
|
510
|
+
const newExposed = `${existingExposed}, bm-properties`.replace(/^, /, '');
|
|
511
|
+
|
|
512
|
+
if (!existingExposed.match(/bm-properties/i)) {
|
|
513
|
+
res.header('Access-Control-Expose-Headers', newExposed);
|
|
514
|
+
}
|
|
515
|
+
|
|
506
516
|
// Attach properties
|
|
507
517
|
if (error) {
|
|
508
518
|
Object.keys(headers)
|