Skip to content

Commit

Permalink
feat: enable OPTIONS middleware by default
Browse files Browse the repository at this point in the history
  • Loading branch information
TrickyPi committed Jul 30, 2022
1 parent c373320 commit a272218
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 3 additions & 2 deletions lib/Server.js
Expand Up @@ -2131,7 +2131,8 @@ class Server {
middleware: this.setHeaders.bind(this),
});
}
if (this.options.optionsMethod) {

{
/**
*
* @param {Request} req
Expand All @@ -2151,7 +2152,7 @@ class Server {
};

middlewares.push({
name: "options-request-response",
name: "options-middleware",
path: "*",
middleware: optionsRequestResponseMiddleware,
});
Expand Down
10 changes: 0 additions & 10 deletions lib/options.json
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -1178,9 +1171,6 @@
"headers": {
"$ref": "#/definitions/Headers"
},
"optionsMethod": {
"$ref": "#/definitions/OptionsMethod"
},
"historyApiFallback": {
"$ref": "#/definitions/HistoryApiFallback"
},
Expand Down

0 comments on commit a272218

Please sign in to comment.