Skip to content

Commit 7b3017a

Browse files
committed
Added support for getUri.
1 parent de07546 commit 7b3017a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ module ClientRequest {
222222
method = "request"
223223
or
224224
this = axios().getMember(method).getACall() and
225-
method = [httpMethodName(), "request", "postForm", "putForm", "patchForm"]
225+
method = [httpMethodName(), "request", "postForm", "putForm", "patchForm", "getUri"]
226226
}
227227

228228
private int getOptionsArgIndex() {

javascript/ql/test/library-tests/frameworks/ClientRequests/ClientRequests.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ test_ClientRequest
102102
| tst.js:327:5:327:36 | axios.p ... config) |
103103
| tst.js:328:5:328:30 | axios.p ... , data) |
104104
| tst.js:329:5:329:38 | axios.p ... config) |
105+
| tst.js:330:5:330:30 | axios.g ... url }) |
105106
test_getADataNode
106107
| axiosTest.js:12:5:17:6 | axios({ ... \\n }) | axiosTest.js:15:18:15:55 | { 'Cont ... json' } |
107108
| axiosTest.js:12:5:17:6 | axios({ ... \\n }) | axiosTest.js:16:15:16:35 | {x: 'te ... 'test'} |
@@ -269,6 +270,7 @@ test_getUrl
269270
| tst.js:327:5:327:36 | axios.p ... config) | tst.js:327:19:327:21 | url |
270271
| tst.js:328:5:328:30 | axios.p ... , data) | tst.js:328:21:328:23 | url |
271272
| tst.js:329:5:329:38 | axios.p ... config) | tst.js:329:21:329:23 | url |
273+
| tst.js:330:5:330:30 | axios.g ... url }) | tst.js:330:18:330:29 | { url: url } |
272274
test_getAResponseDataNode
273275
| axiosTest.js:4:5:7:6 | axios({ ... \\n }) | axiosTest.js:4:5:7:6 | axios({ ... \\n }) | json | true |
274276
| axiosTest.js:12:5:17:6 | axios({ ... \\n }) | axiosTest.js:12:5:17:6 | axios({ ... \\n }) | json | true |
@@ -354,3 +356,4 @@ test_getAResponseDataNode
354356
| tst.js:327:5:327:36 | axios.p ... config) | tst.js:327:5:327:36 | axios.p ... config) | json | true |
355357
| tst.js:328:5:328:30 | axios.p ... , data) | tst.js:328:5:328:30 | axios.p ... , data) | json | true |
356358
| tst.js:329:5:329:38 | axios.p ... config) | tst.js:329:5:329:38 | axios.p ... config) | json | true |
359+
| tst.js:330:5:330:30 | axios.g ... url }) | tst.js:330:5:330:30 | axios.g ... url }) | json | true |

javascript/ql/test/library-tests/frameworks/ClientRequests/tst.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,5 +327,5 @@ function moreAxiosTests(url, data, config){
327327
axios.putForm(url, data, config);
328328
axios.patchForm(url, data);
329329
axios.patchForm(url, data, config);
330-
axios.getUri({ url: url }); // not flagged
330+
axios.getUri({ url: url });
331331
}

0 commit comments

Comments
 (0)