diff --git a/lib/Server.js b/lib/Server.js index 12f5af7512..83b509ee29 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -2131,7 +2131,8 @@ class Server { middleware: this.setHeaders.bind(this), }); } - if (this.options.optionsMethod) { + + { /** * * @param {Request} req @@ -2151,7 +2152,7 @@ class Server { }; middlewares.push({ - name: "options-request-response", + name: "options-middleware", path: "*", middleware: optionsRequestResponseMiddleware, }); diff --git a/lib/options.json b/lib/options.json index dfcf727a8c..ad49a930d7 100644 --- a/lib/options.json +++ b/lib/options.json @@ -458,13 +458,6 @@ "description": "Allows to set custom headers on response.", "link": "https://webpack.js.org/configuration/dev-server/#devserverheaders" }, - "OptionsMethod": { - "type": "boolean", - "description": "Response with 204 httpCode when receive an OPTIONS request", - "cli": { - "exclude": true - } - }, "HistoryApiFallback": { "anyOf": [ { @@ -1178,9 +1171,6 @@ "headers": { "$ref": "#/definitions/Headers" }, - "optionsMethod": { - "$ref": "#/definitions/OptionsMethod" - }, "historyApiFallback": { "$ref": "#/definitions/HistoryApiFallback" }, diff --git a/types/lib/Server.d.ts b/types/lib/Server.d.ts index cc2061e3a8..26c8d7839e 100644 --- a/types/lib/Server.d.ts +++ b/types/lib/Server.d.ts @@ -2217,17 +2217,11 @@ declare class Server { description: string; link: string; }; - OptionsMethod: { - type: string; - description: string; - cli: { - exclude: boolean; - }; - }; HistoryApiFallback: { anyOf: ( | { type: string; + /** @type {ClientConfiguration} */ cli: { negatedDescription: string; }; @@ -2236,7 +2230,6 @@ declare class Server { } | { type: string; - /** @type {string} */ description: string; link: string; cli?: undefined /** @typedef {import("express").Request} Request */; @@ -2301,7 +2294,7 @@ declare class Server { cli: { negatedDescription: string; }; - /** @type {number | string} */ link: string; + link: string; }; MagicHTML: { type: string; @@ -2456,7 +2449,6 @@ declare class Server { Proxy: { anyOf: ( | { - /** @type {any} */ type: string; items?: undefined; } @@ -2476,7 +2468,7 @@ declare class Server { }; } )[]; - description: string; + /** @type {any} */ description: string; link: string; }; Server: { @@ -2486,7 +2478,6 @@ declare class Server { link: string; description: string; }; - /** @type {MultiCompiler} */ ServerType: { enum: string[]; }; @@ -2637,10 +2628,6 @@ declare class Server { } | { instanceof: string; - /** - * @param {string | Static | undefined} [optionsForStatic] - * @returns {NormalizedStatic} - */ type?: undefined; } )[]; @@ -2930,7 +2917,7 @@ declare class Server { | { enum: boolean[]; cli: { - negatedDescription: string /** @type {Array} */; + negatedDescription: string; }; $ref?: undefined; } @@ -2962,20 +2949,13 @@ declare class Server { exclude: boolean; }; }; - /** - * @param {string | Buffer | undefined} item - * @returns {string | Buffer | undefined} - */ }; - /** - * @param {string | Buffer | undefined} item - * @returns {string | Buffer | undefined} - */ additionalProperties: boolean; }; + /** @type {any} */ WebSocketServerString: { type: string; - minLength: number; + /** @type {ServerOptions} */ minLength: number; }; }; additionalProperties: boolean; @@ -2998,9 +2978,6 @@ declare class Server { headers: { $ref: string; }; - optionsMethod: { - $ref: string; - }; historyApiFallback: { $ref: string; }; @@ -3023,7 +3000,7 @@ declare class Server { $ref: string; }; magicHtml: { - $ref: string; + $ref: string /** @type {ServerOptions} */; }; onAfterSetupMiddleware: { $ref: string;