Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .swp
Binary file not shown.
21 changes: 21 additions & 0 deletions client/src/components/HelpDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,27 @@ const HelpDialog = observer(({ open, onClose }: Props) => {
</div>
<h3>Parenthesis</h3>
Parenthesis can be used to group related search terms together.
<p></p>
<h3>HTTP Filters</h3>
These HTTP field filters are supported:
<dl>
<dt>host</dt>
<dd>HTTP request host name (e.g., host:my.host.name).</dd>
<dt>status</dt>
<dd>HTTP response status code (e.g., status:&gt;=500).</dd>
<dt>method</dt>
<dd>HTTP request method (e.g., method:post).</dd>
<dt>url</dt>
<dd>HTTP request URL string (e.g., utl:my/url/path)</dd>
</dl>
Any field may be filtered in the:
<ul>
<li>Request Headers</li>
<li>Response Headers</li>
<li>Request Body</li>
<li>Response Body</li>
</ul>
A full text search is used by default.
</div>
</TabPanel>
<TabPanel value="4" key="4">
Expand Down
47 changes: 47 additions & 0 deletions client/src/store/FilterStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ export default class FilterStore {
this.sortByKeys.push(key);
}

return this.isKeyValueMatch(value, operator, jsonValue);
}

private isKeyValueMatch(value: string, operator: string, jsonValue: any) {
if (value === '*' && (operator === '==' || operator === '===')) {
return true;
}
Expand Down Expand Up @@ -515,6 +519,7 @@ export default class FilterStore {
if (key === 'app' && (operator === '==' || operator === '===')) {
if (messageStore.getLogEntry().appName.startsWith(value)) return false;
}

if (typeof message.requestBody !== 'string') {
if (key === '*' && JSON.stringify(message.requestBody).indexOf(`:"${value}"`) !== -1) {
return false;
Expand All @@ -529,6 +534,48 @@ export default class FilterStore {
if (this.isJsonKeyValueMatch(key, value, operator, message.responseBody as { [key: string]: any })) return false;
}
}
if (typeof message.requestHeaders !== 'string') {
if (key === '*' && JSON.stringify(message.requestHeaders).indexOf(`:"${value}"`) !== -1) {
return false;
} else {
if (this.isJsonKeyValueMatch(key, value, operator, message.requestHeaders as { [key: string]: any })) return false;
}
}
if (typeof message.responseHeaders !== 'string') {
if (key === '*' && JSON.stringify(message.responseHeaders).indexOf(`:"${value}"`) !== -1) {
return false;
} else {
if (this.isJsonKeyValueMatch(key, value, operator, message.responseHeaders as { [key: string]: any })) return false;
}
}
if (message.status !== undefined) {
if (key === 'status') {
if (this.isKeyValueMatch(value, operator, message.status)) {
return false;
}
}
}
if (message.method !== undefined) {
if (key === 'method') {
if (this.isKeyValueMatch(value, operator, message.method)) {
return false;
}
}
}
if (message.serverHost.length > 0) {
if (key === 'host') {
if (this.isKeyValueMatch(value, operator, message.serverHost)) {
return false;
}
}
}
if (message.url) {
if (key === 'url') {
if (this.isKeyValueMatch(value, operator, message.url)) {
return false;
}
}
}
if (this.isJsonKeyValueMatch(key, value, operator, messageStore.getLogEntry().additionalJSON)) return false;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion package-electron.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "allproxy",
"version": "3.38.0",
"version": "3.39.0",
"description": "AllProxy: MITM HTTP Debugging Tool.",
"keywords": [
"proxy",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "allproxy",
"version": "3.38.0",
"version": "3.39.0",
"description": "AllProxy: MITM HTTP Debugging Tool.",
"keywords": [
"proxy",
Expand Down