mirror of
https://github.com/denoland/deno.git
synced 2025-01-09 07:39:15 -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
60fe8aa532
commit
107ba10626
1 changed files with 11 additions and 0 deletions
|
@ -627,6 +627,17 @@ function serve(arg1, arg2) {
|
||||||
reusePort: options.reusePort ?? false,
|
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;
|
let listener;
|
||||||
if (wantsHttps) {
|
if (wantsHttps) {
|
||||||
if (!options.cert || !options.key) {
|
if (!options.cert || !options.key) {
|
||||||
|
|
Loading…
Reference in a new issue