Skip to content

Commit

Permalink
Don't use signal when listen-timeout=0
Browse files Browse the repository at this point in the history
  • Loading branch information
fredsted committed Aug 9, 2024
1 parent f06d377 commit 058f2ad
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 46 deletions.
7 changes: 5 additions & 2 deletions commands/forward.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ export default async (argv) => {
method: data.request.method,
headers: data.request.headers,
body: null,
// Enough time to clear token listen property when command exits.
signal: AbortSignal.timeout(listenSeconds*1000),
};

if (listenSeconds > 0) {
// Enough time to clear token listen property when command exits.
options['signal'] = AbortSignal.timeout(listenSeconds*1000);
}

const removeHeaders = [
'host',
'content-length'
Expand Down
66 changes: 23 additions & 43 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
Expand Up @@ -2,7 +2,7 @@
"name": "@webhooksite/cli",
"description": "Client for Webhook.site",
"repository": "webhooksite/cli",
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down

0 comments on commit 058f2ad

Please sign in to comment.