@govuk-pay/pay-js-commons 7.0.26 → 7.0.27
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.
|
@@ -38,7 +38,7 @@ var detectErrorsMiddleware = function detectErrorsMiddleware(logger) {
|
|
|
38
38
|
next();
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
var captureEventMiddleware = function captureEventMiddleware(ignoredStrings, logger,
|
|
41
|
+
var captureEventMiddleware = function captureEventMiddleware(ignoredStrings, logger, Sentry) {
|
|
42
42
|
return function (req, res) {
|
|
43
43
|
var reports = undefined;
|
|
44
44
|
if (Array.isArray(req.body) && req.body.length > 0) {
|
|
@@ -62,7 +62,7 @@ var captureEventMiddleware = function captureEventMiddleware(ignoredStrings, log
|
|
|
62
62
|
return res.status(400).end();
|
|
63
63
|
} else {
|
|
64
64
|
if (hasSubstr(ignoredStrings, blockedUri)) return res.status(204).end();
|
|
65
|
-
|
|
65
|
+
Sentry.captureEvent({
|
|
66
66
|
message: "Blocked ".concat(violatedDirective, " from ").concat(blockedUri),
|
|
67
67
|
level: 'warning',
|
|
68
68
|
extra: {
|
|
@@ -80,6 +80,7 @@ var captureEventMiddleware = function captureEventMiddleware(ignoredStrings, log
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
module.exports = {
|
|
83
|
+
hasSubstr: hasSubstr,
|
|
83
84
|
rateLimitMiddleware: rateLimitMiddleware,
|
|
84
85
|
captureEventMiddleware: captureEventMiddleware,
|
|
85
86
|
requestParseMiddleware: requestParseMiddleware,
|