webpack-dev-server 4.7.1 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6459,7 +6459,7 @@ function Url(address, location, parser) {
6459
6459
 
6460
6460
  if (url.auth) {
6461
6461
  instruction = url.auth.split(':');
6462
- url.username = instruction[0] || '';
6462
+ url.username = instruction[0];
6463
6463
  url.password = instruction[1] || '';
6464
6464
  }
6465
6465
 
@@ -6544,8 +6544,15 @@ function set(part, value, fn) {
6544
6544
 
6545
6545
  break;
6546
6546
 
6547
- default:
6548
- url[part] = value;
6547
+ case 'username':
6548
+ case 'password':
6549
+ url[part] = encodeURIComponent(value);
6550
+ break;
6551
+
6552
+ case 'auth':
6553
+ var splits = value.split(':');
6554
+ url.username = splits[0];
6555
+ url.password = splits.length === 2 ? splits[1] : '';
6549
6556
  }
6550
6557
 
6551
6558
  for (var i = 0; i < rules.length; i++) {
@@ -6553,6 +6560,7 @@ function set(part, value, fn) {
6553
6560
  if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
6554
6561
  }
6555
6562
 
6563
+ url.auth = url.password ? url.username + ':' + url.password : url.username;
6556
6564
  url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host ? url.protocol + '//' + url.host : 'null';
6557
6565
  url.href = url.toString();
6558
6566
  return url;
@@ -6572,12 +6580,15 @@ function toString(stringify) {
6572
6580
  url = this,
6573
6581
  protocol = url.protocol;
6574
6582
  if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
6575
- var result = protocol + (url.slashes || isSpecial(url.protocol) ? '//' : '');
6583
+ var result = protocol + (url.protocol && url.slashes || isSpecial(url.protocol) ? '//' : '');
6576
6584
 
6577
6585
  if (url.username) {
6578
6586
  result += url.username;
6579
6587
  if (url.password) result += ':' + url.password;
6580
6588
  result += '@';
6589
+ } else if (url.password) {
6590
+ result += ':' + url.password;
6591
+ result += '@';
6581
6592
  }
6582
6593
 
6583
6594
  result += url.host + url.pathname;
package/lib/Server.js CHANGED
@@ -2375,10 +2375,6 @@ class Server {
2375
2375
  });
2376
2376
  }
2377
2377
 
2378
- if (typeof this.options.onAfterSetupMiddleware === "function") {
2379
- this.options.onAfterSetupMiddleware(this);
2380
- }
2381
-
2382
2378
  if (typeof this.options.setupMiddlewares === "function") {
2383
2379
  middlewares = this.options.setupMiddlewares(middlewares, this);
2384
2380
  }
@@ -2395,6 +2391,10 @@ class Server {
2395
2391
  (this.app).use(middleware.middleware);
2396
2392
  }
2397
2393
  });
2394
+
2395
+ if (typeof this.options.onAfterSetupMiddleware === "function") {
2396
+ this.options.onAfterSetupMiddleware(this);
2397
+ }
2398
2398
  }
2399
2399
 
2400
2400
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-dev-server",
3
- "version": "4.7.1",
3
+ "version": "4.7.2",
4
4
  "description": "Serves a webpack app. Updates the browser on changes.",
5
5
  "bin": "bin/webpack-dev-server.js",
6
6
  "main": "lib/Server.js",
@@ -73,8 +73,8 @@
73
73
  "@babel/plugin-transform-runtime": "^7.14.5",
74
74
  "@babel/preset-env": "^7.14.5",
75
75
  "@babel/runtime": "^7.14.5",
76
- "@commitlint/cli": "^15.0.0",
77
- "@commitlint/config-conventional": "^15.0.0",
76
+ "@commitlint/cli": "^16.0.1",
77
+ "@commitlint/config-conventional": "^16.0.0",
78
78
  "@types/compression": "^1.7.2",
79
79
  "@types/default-gateway": "^3.0.1",
80
80
  "@types/sockjs-client": "^1.5.1",