Skip to content

Commit 96bff25

Browse files
authored
Merge branch 'master' into publicPath-output
2 parents a1d7f0c + 6ee8cd0 commit 96bff25

13 files changed

+1391
-1522
lines changed

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
matrix:
7171
os: [ubuntu-latest, windows-latest, macos-latest]
72-
node-version: [18.x, 20.x, 22.x, 23.x]
72+
node-version: [18.x, 20.x, 22.x, 24.x]
7373
shard: ["1/4", "2/4", "3/4", "4/4"]
7474
webpack-version: [latest]
7575

client-src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ if (parsedResourceQuery.overlay) {
183183

184184
decodeOverlayOptions(options.overlay);
185185
}
186-
enabledFeatures.Overlay = true;
186+
enabledFeatures.Overlay = options.overlay !== false;
187187
}
188188

189189
if (parsedResourceQuery.logging) {

lib/Server.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3143,17 +3143,14 @@ class Server {
31433143
// always allow localhost host, for convenience
31443144
// allow if value is in allowedHosts
31453145
if (Array.isArray(allowedHosts) && allowedHosts.length > 0) {
3146-
for (let hostIdx = 0; hostIdx < allowedHosts.length; hostIdx++) {
3147-
/** @type {string} */
3148-
const allowedHost = allowedHosts[hostIdx];
3149-
3146+
for (const allowedHost of allowedHosts) {
31503147
if (allowedHost === value) {
31513148
return true;
31523149
}
31533150

31543151
// support "." as a subdomain wildcard
31553152
// e.g. ".example.com" will allow "example.com", "www.example.com", "subdomain.example.com", etc
3156-
if (allowedHost[0] === ".") {
3153+
if (allowedHost.startsWith(".")) {
31573154
// "example.com" (value === allowedHost.substring(1))
31583155
// "*.example.com" (value.endsWith(allowedHost))
31593156
if (
@@ -3240,12 +3237,7 @@ class Server {
32403237
hostname.endsWith(".localhost") ||
32413238
hostname === this.options.host;
32423239

3243-
if (isValidHostname) {
3244-
return true;
3245-
}
3246-
3247-
// disallow
3248-
return false;
3240+
return isValidHostname;
32493241
}
32503242

32513243
/**

package-lock.json

Lines changed: 841 additions & 845 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"connect-history-api-fallback": "^2.0.0",
6363
"express": "^4.21.2",
6464
"graceful-fs": "^4.2.6",
65-
"http-proxy-middleware": "^2.0.7",
65+
"http-proxy-middleware": "^2.0.9",
6666
"ipaddr.js": "^2.1.0",
6767
"launch-editor": "^2.6.1",
6868
"open": "^10.0.3",

test/cli/server-option.test.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,24 @@ describe('"server" CLI options', () => {
4646
).toMatchSnapshot();
4747
});
4848

49-
it('should work using "--server-type spdy"', async () => {
50-
const { exitCode, stderr } = await testBin([
51-
"--port",
52-
port,
53-
"--server-type",
54-
"spdy",
55-
]);
56-
57-
expect(exitCode).toEqual(0);
58-
expect(
59-
normalizeStderr(stderr, { ipv6: true, https: true }),
60-
).toMatchSnapshot();
61-
});
49+
const [major] = process.versions.node.split(".").map(Number);
50+
51+
(major >= 24 ? it.skip : it)(
52+
'should work using "--server-type spdy"',
53+
async () => {
54+
const { exitCode, stderr } = await testBin([
55+
"--port",
56+
port,
57+
"--server-type",
58+
"spdy",
59+
]);
60+
61+
expect(exitCode).toEqual(0);
62+
expect(
63+
normalizeStderr(stderr, { ipv6: true, https: true }),
64+
).toMatchSnapshot();
65+
},
66+
);
6267

6368
it('should work using "--server-options-key <path> --server-options-pfx <path> --server-options-passphrase webpack-dev-server --server-options-cert <path>"', async () => {
6469
const pfxFile = path.join(httpsCertificateDirectory, "server.pfx");

0 commit comments

Comments
 (0)