We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 446e35b commit 18fe3a4Copy full SHA for 18fe3a4
packages/cli/src/commands/respect/connection-client.ts
@@ -56,8 +56,19 @@ export function withConnectionClient(mtlsCerts: MtlsCerts = {}) {
56
return fetch;
57
}
58
59
- return (input: string | URL | RequestInfo, init?: RequestInit) => {
60
- const url = typeof input === 'string' ? input : 'url' in input ? input.url : input.toString();
+ return (input: RequestInfo, init?: RequestInit) => {
+ const url =
61
+ typeof input === 'string'
62
+ ? input
63
+ : input instanceof URL
64
+ ? input.toString()
65
+ : 'url' in input
66
+ ? input.url
67
+ : undefined;
68
+
69
+ if (!url) {
70
+ throw new Error('Invalid input URL');
71
+ }
72
73
return fetch(input, {
74
...init,
0 commit comments