roboto-js 1.1.12 → 1.1.13

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.
@@ -52,8 +52,9 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
52
52
  };
53
53
 
54
54
  // DEVELOPMENT
55
- if (this.config.baseUrl.indexOf('rbt.dorfio') !== -1) {
56
- this.config.baseUrl = 'http://rbt.dorfio.com';
55
+ var baseUrl = new URL(this.config.baseUrl);
56
+ if (baseUrl.hostname === 'rbt.dorfio.com' || baseUrl.hostname.startsWith('localhost')) {
57
+ this.config.baseUrl = url.toString().replace(/^https:/, 'http:');
57
58
  }
58
59
 
59
60
  // Check if a request object is provided
package/dist/esm/index.js CHANGED
@@ -20,8 +20,9 @@ export default class Roboto {
20
20
  };
21
21
 
22
22
  // DEVELOPMENT
23
- if (this.config.baseUrl.indexOf('rbt.dorfio') !== -1) {
24
- this.config.baseUrl = 'http://rbt.dorfio.com';
23
+ const baseUrl = new URL(this.config.baseUrl);
24
+ if (baseUrl.hostname === 'rbt.dorfio.com' || baseUrl.hostname.startsWith('localhost')) {
25
+ this.config.baseUrl = url.toString().replace(/^https:/, 'http:');
25
26
  }
26
27
 
27
28
  // Check if a request object is provided
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/index.js CHANGED
@@ -31,10 +31,12 @@ export default class Roboto{
31
31
  };
32
32
 
33
33
  // DEVELOPMENT
34
- if(this.config.baseUrl.indexOf('rbt.dorfio')!==-1){
35
- this.config.baseUrl = 'http://rbt.dorfio.com';
34
+ const baseUrl = new URL(this.config.baseUrl);
35
+ if (baseUrl.hostname === 'rbt.dorfio.com' || baseUrl.hostname.startsWith('localhost')) {
36
+ this.config.baseUrl = url.toString().replace(/^https:/, 'http:');
36
37
  }
37
38
 
39
+
38
40
  // Check if a request object is provided
39
41
  if (proxyReq && proxyReq.headers) {
40
42
  const authtoken = proxyReq.headers.authtoken;