Skip to content

Commit

Permalink
Update SDK and use HTTPQL api to filter reuqests
Browse files Browse the repository at this point in the history
  • Loading branch information
Splinter0 committed Nov 2, 2024
1 parent 26ba485 commit 3a698af
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 31 deletions.
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"shared": "workspace:*"
},
"devDependencies": {
"@caido/sdk-backend": "0.42.0"
"@caido/sdk-backend": "0.43.1"
}
}
5 changes: 2 additions & 3 deletions packages/backend/src/services/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@ export const onInterceptResponse = async (
if (settings.autoCaptureRequests == "off") {
return;
}

const matchingQuery = await sdk.requests.query().filter(`req.path.eq:"${request.getPath()}" AND req.host.eq:"${request.getHost()}" AND req.method.eq:"${request.getMethod()}" AND ${settings.defaultFilterHTTPQL}`).descending("req", "id").execute();
if (matchingQuery.items.at(0)?.request.getId() !== request.getId()) {

if (!sdk.requests.matches(settings.defaultFilterHTTPQL, request)) {
sdk.console.log(`Filtering: ${request.getUrl()}`)
return;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@caido/primevue": "0.1.1",
"@caido/sdk-frontend": "0.42.0",
"@caido/sdk-frontend": "0.43.1",
"@fortawesome/fontawesome-free": "6.6.0",
"@vueuse/core": "10.11.1",
"pinia": "2.2.1",
Expand All @@ -20,7 +20,7 @@
"vue": "3.4.37"
},
"devDependencies": {
"@caido/sdk-backend": "0.42.0",
"@caido/sdk-backend": "0.43.1",
"@caido/tailwindcss": "0.0.1",
"@codemirror/view": "6.28.1",
"@vitejs/plugin-vue": "5.1.2",
Expand Down
41 changes: 16 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3a698af

Please sign in to comment.