Skip to content

Commit bb6ef72

Browse files
committed
getArgument returns Cors::Cors
1 parent aa24ce5 commit bb6ef72

File tree

1 file changed

+5
-3
lines changed
  • javascript/ql/lib/semmle/javascript/frameworks

1 file changed

+5
-3
lines changed

javascript/ql/lib/semmle/javascript/frameworks/Express.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,13 +1081,15 @@ module Express {
10811081
this = appCreation().getAMethodCall("use") and this.getArgument(0) instanceof Cors::Cors
10821082
}
10831083

1084+
Cors::Cors getArgument() { result = this.getArgument(0) }
1085+
10841086
/** Gets the options used to configure `cors`. */
1085-
DataFlow::Node getCorsArgument() { result = this.getArgument(0).(Cors::Cors).getCorsArgument() }
1087+
DataFlow::Node getCorsArgument() { result = this.getArgument().getOptionsArgument() }
10861088

10871089
/** Holds if cors is using its default configuration. */
1088-
predicate isDefault() { this.getArgument(0).(Cors::Cors).isDefault() }
1090+
predicate isDefault() { this.getArgument().isDefault() }
10891091

10901092
/** Gets the `origin` option that the call to `cors` is configured with. */
1091-
DataFlow::Node getOrigin() { result = this.getArgument(0).(Cors::Cors).getOrigin() }
1093+
DataFlow::Node getOrigin() { result = this.getArgument().getOrigin() }
10921094
}
10931095
}

0 commit comments

Comments
 (0)