We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c539138 + 8929ccc commit c681aa7Copy full SHA for c681aa7
rules/detect-no-csrf-before-method-override.js
@@ -1,6 +1,6 @@
1
/**
2
- * Check and see if CSRF middleware is before methodOverride
3
- * @author Adam Baldwin
+ * Check and see if CSRF middleware is before methodOverride
+ * @author Adam Baldwin
4
*/
5
6
//------------------------------------------------------------------------------
@@ -20,6 +20,10 @@ module.exports = function(context) {
20
nodeValue = token.value;
21
22
if (nodeValue === "express") {
23
+ if (!node.callee || !node.callee.property) {
24
+ return;
25
+ }
26
+
27
if (node.callee.property.name === "methodOverride" && csrf) {
28
context.report(node, "express.csrf() middleware found before express.methodOverride()");
29
}
0 commit comments