Skip to content

Commit d0c5543

Browse files
committed
feat: forbid proxying over HTTPS
1 parent 2d4e416 commit d0c5543

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ program //
1919
.option('-p, --port <port>', 'port number on which to run the proxy', 8888)
2020
.option(
2121
'-t, --target <target>',
22-
'full base path of the target API (format: http(s)://host:port/basePath)',
22+
'full base path of the target API (format: http://host:port/basePath)',
2323
)
2424
.option(
2525
'--default-forbid-additional-properties',
@@ -69,6 +69,10 @@ if (isNaN(Number(targetPort))) {
6969
process.exit();
7070
}
7171
}
72+
if (program.target.startsWith('https://')) {
73+
console.log('HTTPS is not supported. Not possible to modify requests/responses when the channel is encrypted. Consider to use openapi-cop behind a SSL proxy.\n');
74+
process.exit();
75+
}
7276
if (
7377
program.target.indexOf('//localhost') !== -1 &&
7478
program.target.indexOf('//0.0.0.0') !== -1 &&

0 commit comments

Comments
 (0)