mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 07:44:48 -05:00
fix(ext/http): Error on deprecated/unavailable features (#19880)
Throws an error when user code attempts to use unsupported options (may help reduce confusion when migrating to Deno.serve)
This commit is contained in:
parent
5919f31891
commit
aa95a3a6e0
1 changed files with 11 additions and 0 deletions
|
@ -627,6 +627,17 @@ function serve(arg1, arg2) {
|
|||
reusePort: options.reusePort ?? false,
|
||||
};
|
||||
|
||||
if (options.certFile || options.keyFile) {
|
||||
throw new TypeError(
|
||||
"Unsupported 'certFile' / 'keyFile' options provided: use 'cert' / 'key' instead.",
|
||||
);
|
||||
}
|
||||
if (options.alpnProtocols) {
|
||||
throw new TypeError(
|
||||
"Unsupported 'alpnProtocols' option provided. 'h2' and 'http/1.1' are automatically supported.",
|
||||
);
|
||||
}
|
||||
|
||||
let listener;
|
||||
if (wantsHttps) {
|
||||
if (!options.cert || !options.key) {
|
||||
|
|
Loading…
Reference in a new issue