@cloudcare/browser-core 1.0.16 → 1.0.17

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.
@@ -91,6 +91,7 @@ function commonInit(userConfiguration, buildEnv) {
91
91
  applicationId: userConfiguration.applicationId,
92
92
  env: userConfiguration.env || '',
93
93
  version: userConfiguration.version || '',
94
+ service: userConfiguration.service || 'browser',
94
95
  sdkVersion: buildEnv.sdkVersion,
95
96
  sdkName: buildEnv.sdkName,
96
97
  datakitUrl: getDatakitUrl(userConfiguration.datakitUrl || userConfiguration.datakitOrigin),
@@ -803,8 +803,8 @@ var urlParse = function urlParse(para) {
803
803
 
804
804
  URLParser.prototype.getUrl = function () {
805
805
  var url = '';
806
- url += this._values.Origin;
807
- url += this._values.Port ? ':' + this._values.Port : '';
806
+ url += this._values.Origin; // url += this._values.Port ? ':' + this._values.Port : ''
807
+
808
808
  url += this._values.Path;
809
809
  url += this._values.QueryString ? '?' + this._values.QueryString : '';
810
810
  return url;
@@ -825,8 +825,11 @@ var urlParse = function urlParse(para) {
825
825
  }
826
826
  }
827
827
 
828
+ this._values['Path'] = this._values['Path'] || '/';
828
829
  this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, '');
829
- this._values['Origin'] = this._values['Protocol'] + '://' + this._values['Hostname'];
830
+ this._values['Origin'] = this._values['Protocol'] + '://' + this._values['Hostname'] + (this._values.Port ? ':' + this._values.Port : ''); // this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, '')
831
+ // this._values['Origin'] =
832
+ // this._values['Protocol'] + '://' + this._values['Hostname']
830
833
  };
831
834
 
832
835
  return new URLParser(para);
@@ -76,6 +76,7 @@ export function commonInit(userConfiguration, buildEnv) {
76
76
  applicationId: userConfiguration.applicationId,
77
77
  env: userConfiguration.env || '',
78
78
  version: userConfiguration.version || '',
79
+ service: userConfiguration.service || 'browser',
79
80
  sdkVersion: buildEnv.sdkVersion,
80
81
  sdkName: buildEnv.sdkName,
81
82
  datakitUrl: getDatakitUrl(userConfiguration.datakitUrl || userConfiguration.datakitOrigin),
@@ -625,8 +625,8 @@ export var urlParse = function urlParse(para) {
625
625
 
626
626
  URLParser.prototype.getUrl = function () {
627
627
  var url = '';
628
- url += this._values.Origin;
629
- url += this._values.Port ? ':' + this._values.Port : '';
628
+ url += this._values.Origin; // url += this._values.Port ? ':' + this._values.Port : ''
629
+
630
630
  url += this._values.Path;
631
631
  url += this._values.QueryString ? '?' + this._values.QueryString : '';
632
632
  return url;
@@ -647,8 +647,11 @@ export var urlParse = function urlParse(para) {
647
647
  }
648
648
  }
649
649
 
650
+ this._values['Path'] = this._values['Path'] || '/';
650
651
  this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, '');
651
- this._values['Origin'] = this._values['Protocol'] + '://' + this._values['Hostname'];
652
+ this._values['Origin'] = this._values['Protocol'] + '://' + this._values['Hostname'] + (this._values.Port ? ':' + this._values.Port : ''); // this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, '')
653
+ // this._values['Origin'] =
654
+ // this._values['Protocol'] + '://' + this._values['Hostname']
652
655
  };
653
656
 
654
657
  return new URLParser(para);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-core",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "scripts": {
@@ -20,5 +20,5 @@
20
20
  "author": "dataflux",
21
21
  "license": "MIT",
22
22
  "description": "DataFlux RUM Web 端数据指标监控",
23
- "gitHead": "82f05e083d4c4a86615dd759de38dda0674eb84f"
23
+ "gitHead": "aa44bc2dbca2017e36e0561d810825e89715d847"
24
24
  }
@@ -77,6 +77,7 @@ export function commonInit(userConfiguration, buildEnv) {
77
77
  applicationId: userConfiguration.applicationId,
78
78
  env: userConfiguration.env || '',
79
79
  version: userConfiguration.version || '',
80
+ service: userConfiguration.service || 'browser',
80
81
  sdkVersion: buildEnv.sdkVersion,
81
82
  sdkName: buildEnv.sdkName,
82
83
  datakitUrl: getDatakitUrl(
@@ -613,7 +613,7 @@ export var urlParse = function (para) {
613
613
  URLParser.prototype.getUrl = function () {
614
614
  var url = ''
615
615
  url += this._values.Origin
616
- url += this._values.Port ? ':' + this._values.Port : ''
616
+ // url += this._values.Port ? ':' + this._values.Port : ''
617
617
  url += this._values.Path
618
618
  url += this._values.QueryString ? '?' + this._values.QueryString : ''
619
619
  return url
@@ -629,9 +629,13 @@ export var urlParse = function (para) {
629
629
  this._values[c] = b[this._fields[c]]
630
630
  }
631
631
  }
632
- this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, '')
633
- this._values['Origin'] =
634
- this._values['Protocol'] + '://' + this._values['Hostname']
632
+ this._values['Path'] = this._values['Path'] || '/'
633
+ this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, '')
634
+ this._values['Origin'] =
635
+ this._values['Protocol'] + '://' + this._values['Hostname'] + (this._values.Port ? ':' + this._values.Port : '')
636
+ // this._values['Hostname'] = this._values['Host'].replace(/:\d+$/, '')
637
+ // this._values['Origin'] =
638
+ // this._values['Protocol'] + '://' + this._values['Hostname']
635
639
  }
636
640
  return new URLParser(para)
637
641
  }