Skip to content

Commit

Permalink
A few tune-ups from bugs discovered during testing.
Browse files Browse the repository at this point in the history
Signed-off-by: Quobix <[email protected]>
  • Loading branch information
daveshanley committed Aug 16, 2023
1 parent c1b107e commit 2df239d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 2 additions & 3 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
<meta name="description"
content="wiretap is a tool that sniffs your API traffic and validates it against an OpenAPI specification.">
<script>
sessionStorage.setItem('wiretapPort', '%WIRETAP_PORT%')
//sessionStorage.setItem('wiretapPort', '9092')
localStorage.setItem('wiretapPort', '%WIRETAP_PORT%')
//localStorage.setItem('wiretapPort', '9092');
const version = '%WIRETAP_VERSION%';
const existingVersion = localStorage.getItem('wiretapVersion');
if (existingVersion !== version) {
localStorage.setItem('wiretapVersion', version);
localStorage.setItem('wiretapWipeCache', 'true');
}

</script>
<script type="module" src="/src/index.ts" defer></script>
<script type="module" src="/src/workers/link_cache_worker.ts"></script>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/controls/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class WiretapControlsComponent extends LitElement {
body: JSON.stringify(
{
id: RanchUtils.genUUID(),
requestCommand: ChangeDelayCommand,
request: ChangeDelayCommand,
payload: {
delay: delay
}
Expand All @@ -155,7 +155,7 @@ export class WiretapControlsComponent extends LitElement {
body: JSON.stringify(
{
id: RanchUtils.genUUID(),
requestCommand: RequestReportCommand,
request: RequestReportCommand,
payload: {}
}
),
Expand Down
2 changes: 1 addition & 1 deletion ui/src/model/http_transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class HttpTransaction extends HttpTransactionBase {
}

matchesMethodFilter(filter: WiretapFilters): Filter | boolean {
if (filter?.filterMethod?.keyword.toLowerCase() === this.httpRequest.method.toLowerCase()) {
if (filter?.filterMethod?.keyword?.toLowerCase() === this.httpRequest?.method?.toLowerCase()) {
return filter.filterMethod;
}
return false;
Expand Down
6 changes: 5 additions & 1 deletion ui/src/wiretap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ export class WiretapComponent extends LitElement {
});

// extract port from session storage.
this._wiretapPort = sessionStorage.getItem("wiretapPort");
this._wiretapPort = localStorage.getItem("wiretapPort");

if (!this._wiretapPort) {
this._wiretapPort = "9092"; // default port
}

// extract version from session storage.
this._wiretapVersion = localStorage.getItem("wiretapVersion");
Expand Down

0 comments on commit 2df239d

Please sign in to comment.