backend-manager 3.2.41 → 3.2.42
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
|
@@ -401,7 +401,7 @@ BackendAssistant.prototype.errorify = function (e, options) {
|
|
|
401
401
|
self.Manager.libraries.sentry.captureException(newError);
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
-
// Quit and respond to the request
|
|
404
|
+
// Quit and respond to the request only if the assistant has a res (it sometimes does not, like in auth().onCreate() triggers)
|
|
405
405
|
if (options.send && res?.status) {
|
|
406
406
|
let sendable = newError?.stack && options.stack
|
|
407
407
|
? newError?.stack
|
|
@@ -422,9 +422,6 @@ BackendAssistant.prototype.errorify = function (e, options) {
|
|
|
422
422
|
.send(sendable);
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
// return {
|
|
426
|
-
// error: newError,
|
|
427
|
-
// }
|
|
428
425
|
return newError;
|
|
429
426
|
}
|
|
430
427
|
|
|
@@ -527,19 +524,17 @@ function _attachHeaderProperties(self, options, error) {
|
|
|
527
524
|
const req = self.ref.req;
|
|
528
525
|
const res = self.ref.res;
|
|
529
526
|
|
|
530
|
-
// Attach properties
|
|
531
|
-
|
|
527
|
+
// Attach properties if this assistant has a res (it sometimes does not, like in auth().onCreate() triggers)
|
|
528
|
+
if (res?.header && res?.get) {
|
|
532
529
|
res.header('bm-properties', JSON.stringify(headers));
|
|
533
|
-
} catch (e) {
|
|
534
|
-
self.warn('Error attaching properties to header', e);
|
|
535
|
-
}
|
|
536
530
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
531
|
+
// Add bm-properties to Access-Control-Expose-Headers
|
|
532
|
+
const existingExposed = res.get('Access-Control-Expose-Headers') || '';
|
|
533
|
+
const newExposed = `${existingExposed}, bm-properties`.replace(/^, /, '');
|
|
540
534
|
|
|
541
|
-
|
|
542
|
-
|
|
535
|
+
if (!existingExposed.match(/bm-properties/i)) {
|
|
536
|
+
res.header('Access-Control-Expose-Headers', newExposed);
|
|
537
|
+
}
|
|
543
538
|
}
|
|
544
539
|
|
|
545
540
|
// Attach properties
|