Skip to content

Commit 2037a3b

Browse files
Merge branch 'master' into feat/overlay-ui
2 parents 73705a7 + 6ee8cd0 commit 2037a3b

11 files changed

+258
-621
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

lib/Server.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3123,17 +3123,14 @@ class Server {
31233123
// always allow localhost host, for convenience
31243124
// allow if value is in allowedHosts
31253125
if (Array.isArray(allowedHosts) && allowedHosts.length > 0) {
3126-
for (let hostIdx = 0; hostIdx < allowedHosts.length; hostIdx++) {
3127-
/** @type {string} */
3128-
const allowedHost = allowedHosts[hostIdx];
3129-
3126+
for (const allowedHost of allowedHosts) {
31303127
if (allowedHost === value) {
31313128
return true;
31323129
}
31333130

31343131
// support "." as a subdomain wildcard
31353132
// e.g. ".example.com" will allow "example.com", "www.example.com", "subdomain.example.com", etc
3136-
if (allowedHost[0] === ".") {
3133+
if (allowedHost.startsWith(".")) {
31373134
// "example.com" (value === allowedHost.substring(1))
31383135
// "*.example.com" (value.endsWith(allowedHost))
31393136
if (
@@ -3220,12 +3217,7 @@ class Server {
32203217
hostname.endsWith(".localhost") ||
32213218
hostname === this.options.host;
32223219

3223-
if (isValidHostname) {
3224-
return true;
3225-
}
3226-
3227-
// disallow
3228-
return false;
3220+
return isValidHostname;
32293221
}
32303222

32313223
/**

package-lock.json

Lines changed: 113 additions & 113 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");

test/e2e/__snapshots__/app.test.js.snap.webpack5

Lines changed: 0 additions & 309 deletions
This file was deleted.

0 commit comments

Comments
 (0)