Skip to content

Commit a272218

Browse files
committed
feat: enable OPTIONS middleware by default
1 parent c373320 commit a272218

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

lib/Server.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,8 @@ class Server {
21312131
middleware: this.setHeaders.bind(this),
21322132
});
21332133
}
2134-
if (this.options.optionsMethod) {
2134+
2135+
{
21352136
/**
21362137
*
21372138
* @param {Request} req
@@ -2151,7 +2152,7 @@ class Server {
21512152
};
21522153

21532154
middlewares.push({
2154-
name: "options-request-response",
2155+
name: "options-middleware",
21552156
path: "*",
21562157
middleware: optionsRequestResponseMiddleware,
21572158
});

lib/options.json

-10
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,6 @@
458458
"description": "Allows to set custom headers on response.",
459459
"link": "https://webpack.js.org/configuration/dev-server/#devserverheaders"
460460
},
461-
"OptionsMethod": {
462-
"type": "boolean",
463-
"description": "Response with 204 httpCode when receive an OPTIONS request",
464-
"cli": {
465-
"exclude": true
466-
}
467-
},
468461
"HistoryApiFallback": {
469462
"anyOf": [
470463
{
@@ -1178,9 +1171,6 @@
11781171
"headers": {
11791172
"$ref": "#/definitions/Headers"
11801173
},
1181-
"optionsMethod": {
1182-
"$ref": "#/definitions/OptionsMethod"
1183-
},
11841174
"historyApiFallback": {
11851175
"$ref": "#/definitions/HistoryApiFallback"
11861176
},

0 commit comments

Comments
 (0)