@percy/core 1.27.5-beta.2 → 1.27.5

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.
Files changed (2) hide show
  1. package/dist/server.js +11 -2
  2. package/package.json +8 -8
package/dist/server.js CHANGED
@@ -157,6 +157,11 @@ export class Server extends http.Server {
157
157
  });
158
158
  }
159
159
 
160
+ // return host bind address - defaults to 0.0.0.0
161
+ get host() {
162
+ return process.env.PERCY_SERVER_HOST || '0.0.0.0';
163
+ }
164
+
160
165
  // return the listening port or any default port
161
166
  get port() {
162
167
  var _super$address;
@@ -166,7 +171,11 @@ export class Server extends http.Server {
166
171
  // return a string representation of the server address
167
172
  address() {
168
173
  let port = this.port;
169
- let host = 'http://localhost';
174
+ // we need to specifically map 0.0.0.0 to localhost on windows as even though we
175
+ // can listen to all interfaces using 0.0.0.0 we cant make a request on 0.0.0.0 as
176
+ // its an invalid ip address as per spec, but unix systems allow request to it and
177
+ // falls back to localhost
178
+ let host = `http://${this.host === '0.0.0.0' ? 'localhost' : this.host}`;
170
179
  return port ? `${host}:${port}` : host;
171
180
  }
172
181
 
@@ -175,7 +184,7 @@ export class Server extends http.Server {
175
184
  return new Promise((resolve, reject) => {
176
185
  let handle = err => off() && err ? reject(err) : resolve(this);
177
186
  let off = () => this.off('error', handle).off('listening', handle);
178
- super.listen(port, handle).once('error', handle);
187
+ super.listen(port, this.host, handle).once('error', handle);
179
188
  });
180
189
  }
181
190
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.27.5-beta.2",
3
+ "version": "1.27.5",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "beta"
12
+ "tag": "latest"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -43,11 +43,11 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.27.5-beta.2",
47
- "@percy/config": "1.27.5-beta.2",
48
- "@percy/dom": "1.27.5-beta.2",
49
- "@percy/logger": "1.27.5-beta.2",
50
- "@percy/webdriver-utils": "1.27.5-beta.2",
46
+ "@percy/client": "1.27.5",
47
+ "@percy/config": "1.27.5",
48
+ "@percy/dom": "1.27.5",
49
+ "@percy/logger": "1.27.5",
50
+ "@percy/webdriver-utils": "1.27.5",
51
51
  "content-disposition": "^0.5.4",
52
52
  "cross-spawn": "^7.0.3",
53
53
  "extract-zip": "^2.0.1",
@@ -58,5 +58,5 @@
58
58
  "rimraf": "^3.0.2",
59
59
  "ws": "^8.0.0"
60
60
  },
61
- "gitHead": "9ea4b1f10c134e2c8135f7dddda764a9edafb336"
61
+ "gitHead": "b28dc5d280584a19345ee45f745229e5f77993e6"
62
62
  }