rollbar 2.25.1 → 2.26.0

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.
@@ -1028,7 +1028,7 @@ module.exports = {
1028
1028
  "use strict";
1029
1029
 
1030
1030
 
1031
- var ErrorStackParser = __webpack_require__(22);
1031
+ var ErrorStackParser = __webpack_require__(24);
1032
1032
 
1033
1033
  var UNKNOWN_FUNCTION = '?';
1034
1034
  var ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');
@@ -1349,12 +1349,12 @@ module.exports = rollbar;
1349
1349
 
1350
1350
 
1351
1351
  var Rollbar = __webpack_require__(9);
1352
- var telemeter = __webpack_require__(29);
1353
- var instrumenter = __webpack_require__(30);
1354
- var polyfillJSON = __webpack_require__(32);
1355
- var wrapGlobals = __webpack_require__(34);
1352
+ var telemeter = __webpack_require__(31);
1353
+ var instrumenter = __webpack_require__(32);
1354
+ var polyfillJSON = __webpack_require__(35);
1355
+ var wrapGlobals = __webpack_require__(37);
1356
1356
  var scrub = __webpack_require__(4);
1357
- var truncation = __webpack_require__(35);
1357
+ var truncation = __webpack_require__(38);
1358
1358
 
1359
1359
  Rollbar.setComponents({
1360
1360
  telemeter: telemeter,
@@ -1384,10 +1384,10 @@ var globals = __webpack_require__(19);
1384
1384
  var Transport = __webpack_require__(20);
1385
1385
  var urllib = __webpack_require__(2);
1386
1386
 
1387
- var transforms = __webpack_require__(21);
1388
- var sharedTransforms = __webpack_require__(24);
1389
- var predicates = __webpack_require__(25);
1390
- var sharedPredicates = __webpack_require__(26);
1387
+ var transforms = __webpack_require__(23);
1388
+ var sharedTransforms = __webpack_require__(26);
1389
+ var predicates = __webpack_require__(27);
1390
+ var sharedPredicates = __webpack_require__(28);
1391
1391
  var errorParser = __webpack_require__(3);
1392
1392
 
1393
1393
  function Rollbar(options, client) {
@@ -1916,8 +1916,8 @@ function _gWindow() {
1916
1916
  return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);
1917
1917
  }
1918
1918
 
1919
- var defaults = __webpack_require__(27);
1920
- var scrubFields = __webpack_require__(28);
1919
+ var defaults = __webpack_require__(29);
1920
+ var scrubFields = __webpack_require__(30);
1921
1921
 
1922
1922
  var defaultOptions = {
1923
1923
  version: defaults.version,
@@ -2993,6 +2993,7 @@ function getTransportFromOptions(options, defaults, url) {
2993
2993
  var path = defaults.path;
2994
2994
  var search = defaults.search;
2995
2995
  var timeout = options.timeout;
2996
+ var transport = detectTransport(options)
2996
2997
 
2997
2998
  var proxy = options.proxy;
2998
2999
  if (options.endpoint) {
@@ -3010,16 +3011,26 @@ function getTransportFromOptions(options, defaults, url) {
3010
3011
  port: port,
3011
3012
  path: path,
3012
3013
  search: search,
3013
- proxy: proxy
3014
+ proxy: proxy,
3015
+ transport: transport
3014
3016
  };
3015
3017
  }
3016
3018
 
3019
+ function detectTransport(options) {
3020
+ var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);
3021
+ var transport = options.defaultTransport || 'xhr';
3022
+ if (typeof gWindow.fetch === 'undefined') transport = 'xhr';
3023
+ if (typeof gWindow.XMLHttpRequest === 'undefined') transport = 'fetch';
3024
+ return transport;
3025
+ }
3026
+
3017
3027
  function transportOptions(transport, method) {
3018
3028
  var protocol = transport.protocol || 'https:';
3019
3029
  var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);
3020
3030
  var hostname = transport.hostname;
3021
3031
  var path = transport.path;
3022
3032
  var timeout = transport.timeout;
3033
+ var transportAPI = transport.transport;
3023
3034
  if (transport.search) {
3024
3035
  path = path + transport.search;
3025
3036
  }
@@ -3035,7 +3046,8 @@ function transportOptions(transport, method) {
3035
3046
  hostname: hostname,
3036
3047
  path: path,
3037
3048
  port: port,
3038
- method: method
3049
+ method: method,
3050
+ transport: transportAPI
3039
3051
  };
3040
3052
  }
3041
3053
 
@@ -3237,10 +3249,9 @@ module.exports = {
3237
3249
  "use strict";
3238
3250
 
3239
3251
 
3240
- /*global XDomainRequest*/
3241
-
3242
3252
  var _ = __webpack_require__(0);
3243
- var logger = __webpack_require__(1);
3253
+ var makeFetchRequest = __webpack_require__(21);
3254
+ var makeXhrRequest = __webpack_require__(22);
3244
3255
 
3245
3256
  /*
3246
3257
  * accessToken may be embedded in payload but that should not
@@ -3252,6 +3263,7 @@ var logger = __webpack_require__(1);
3252
3263
  * path
3253
3264
  * port
3254
3265
  * method
3266
+ * transport ('xhr' | 'fetch')
3255
3267
  * }
3256
3268
  *
3257
3269
  * params is an object containing key/value pairs. These
@@ -3271,7 +3283,9 @@ Transport.prototype.get = function(accessToken, options, params, callback, reque
3271
3283
 
3272
3284
  var method = 'GET';
3273
3285
  var url = _.formatUrl(options);
3274
- _makeZoneRequest(accessToken, url, method, null, callback, requestFactory, options.timeout);
3286
+ this._makeZoneRequest(
3287
+ accessToken, url, method, null, callback, requestFactory, options.timeout, options.transport
3288
+ );
3275
3289
  }
3276
3290
 
3277
3291
  Transport.prototype.post = function(accessToken, options, payload, callback, requestFactory) {
@@ -3296,7 +3310,9 @@ Transport.prototype.post = function(accessToken, options, payload, callback, req
3296
3310
  var writeData = stringifyResult.value;
3297
3311
  var method = 'POST';
3298
3312
  var url = _.formatUrl(options);
3299
- _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory, options.timeout);
3313
+ this._makeZoneRequest(
3314
+ accessToken, url, method, writeData, callback, requestFactory, options.timeout, options.transport
3315
+ );
3300
3316
  }
3301
3317
 
3302
3318
  Transport.prototype.postJsonPayload = function (accessToken, options, jsonPayload, callback, requestFactory) {
@@ -3306,7 +3322,9 @@ Transport.prototype.postJsonPayload = function (accessToken, options, jsonPayloa
3306
3322
 
3307
3323
  var method = 'POST';
3308
3324
  var url = _.formatUrl(options);
3309
- _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory, options.timeout);
3325
+ this._makeZoneRequest(
3326
+ accessToken, url, method, jsonPayload, callback, requestFactory, options.timeout, options.transport
3327
+ );
3310
3328
  }
3311
3329
 
3312
3330
 
@@ -3314,7 +3332,7 @@ Transport.prototype.postJsonPayload = function (accessToken, options, jsonPayloa
3314
3332
  // so Angular change detection isn't triggered on each API call.
3315
3333
  // This is the equivalent of runOutsideAngular().
3316
3334
  //
3317
- function _makeZoneRequest() {
3335
+ Transport.prototype._makeZoneRequest = function () {
3318
3336
  var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);
3319
3337
  var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;
3320
3338
  var args = Array.prototype.slice.call(arguments);
@@ -3322,10 +3340,24 @@ function _makeZoneRequest() {
3322
3340
  if (currentZone && currentZone._name === 'angular') {
3323
3341
  var rootZone = currentZone._parent;
3324
3342
  rootZone.run(function () {
3325
- _makeRequest.apply(undefined, args);
3343
+ this._makeRequest.apply(undefined, args);
3326
3344
  });
3327
3345
  } else {
3328
- _makeRequest.apply(undefined, args);
3346
+ this._makeRequest.apply(undefined, args);
3347
+ }
3348
+ }
3349
+
3350
+ Transport.prototype._makeRequest = function (
3351
+ accessToken, url, method, data, callback, requestFactory, timeout, transport
3352
+ ) {
3353
+ if (typeof RollbarProxy !== 'undefined') {
3354
+ return _proxyRequest(data, callback);
3355
+ }
3356
+
3357
+ if (transport === 'fetch') {
3358
+ makeFetchRequest(accessToken, url, method, data, callback, timeout)
3359
+ } else {
3360
+ makeXhrRequest(accessToken, url, method, data, callback, requestFactory, timeout)
3329
3361
  }
3330
3362
  }
3331
3363
 
@@ -3341,11 +3373,66 @@ function _proxyRequest(json, callback) {
3341
3373
  );
3342
3374
  }
3343
3375
 
3344
- function _makeRequest(accessToken, url, method, data, callback, requestFactory, timeout) {
3345
- if (typeof RollbarProxy !== 'undefined') {
3346
- return _proxyRequest(data, callback);
3376
+ module.exports = Transport;
3377
+
3378
+
3379
+ /***/ }),
3380
+ /* 21 */
3381
+ /***/ (function(module, exports, __webpack_require__) {
3382
+
3383
+ "use strict";
3384
+
3385
+
3386
+ var logger = __webpack_require__(1);
3387
+ var _ = __webpack_require__(0);
3388
+
3389
+ function makeFetchRequest(accessToken, url, method, data, callback, timeout) {
3390
+ var controller;
3391
+ var timeoutId;
3392
+
3393
+ if(_.isFiniteNumber(timeout)) {
3394
+ controller = new AbortController();
3395
+ timeoutId = setTimeout(() => controller.abort(), timeout);
3347
3396
  }
3348
3397
 
3398
+ fetch(url, {
3399
+ method: method,
3400
+ headers: {
3401
+ 'Content-Type': 'application/json',
3402
+ 'X-Rollbar-Access-Token': accessToken,
3403
+ signal: controller && controller.signal
3404
+ },
3405
+ body: data,
3406
+ })
3407
+ .then((response) => {
3408
+ if (timeoutId) clearTimeout(timeoutId);
3409
+ return response.json();
3410
+ })
3411
+ .then((data) => {
3412
+ callback(null, data);
3413
+ })
3414
+ .catch((error) => {
3415
+ logger.error(error.message);
3416
+ callback(error);
3417
+ });
3418
+ }
3419
+
3420
+ module.exports = makeFetchRequest;
3421
+
3422
+
3423
+ /***/ }),
3424
+ /* 22 */
3425
+ /***/ (function(module, exports, __webpack_require__) {
3426
+
3427
+ "use strict";
3428
+
3429
+
3430
+ /*global XDomainRequest*/
3431
+
3432
+ var _ = __webpack_require__(0);
3433
+ var logger = __webpack_require__(1);
3434
+
3435
+ function makeXhrRequest(accessToken, url, method, data, callback, requestFactory, timeout) {
3349
3436
  var request;
3350
3437
  if (requestFactory) {
3351
3438
  request = requestFactory();
@@ -3498,11 +3585,11 @@ function _newRetriableError(message, code) {
3498
3585
  return err;
3499
3586
  }
3500
3587
 
3501
- module.exports = Transport;
3588
+ module.exports = makeXhrRequest;
3502
3589
 
3503
3590
 
3504
3591
  /***/ }),
3505
- /* 21 */
3592
+ /* 23 */
3506
3593
  /***/ (function(module, exports, __webpack_require__) {
3507
3594
 
3508
3595
  "use strict";
@@ -3589,20 +3676,25 @@ function addBaseInfo(item, options, callback) {
3589
3676
 
3590
3677
  function addRequestInfo(window) {
3591
3678
  return function(item, options, callback) {
3592
- if (!window || !window.location) {
3593
- return callback(null, item);
3679
+ var requestInfo = {};
3680
+
3681
+ if (window && window.location) {
3682
+ requestInfo.url = window.location.href;
3683
+ requestInfo.query_string = window.location.search;
3594
3684
  }
3685
+
3595
3686
  var remoteString = '$remote_ip';
3596
3687
  if (!options.captureIp) {
3597
3688
  remoteString = null;
3598
3689
  } else if (options.captureIp !== true) {
3599
3690
  remoteString += '_anonymize';
3600
3691
  }
3601
- _.set(item, 'data.request', {
3602
- url: window.location.href,
3603
- query_string: window.location.search,
3604
- user_ip: remoteString
3605
- });
3692
+ if (remoteString) requestInfo.user_ip = remoteString;
3693
+
3694
+ if (Object.keys(requestInfo).length > 0) {
3695
+ _.set(item, 'data.request', requestInfo);
3696
+ }
3697
+
3606
3698
  callback(null, item);
3607
3699
  };
3608
3700
  }
@@ -3844,7 +3936,7 @@ module.exports = {
3844
3936
 
3845
3937
 
3846
3938
  /***/ }),
3847
- /* 22 */
3939
+ /* 24 */
3848
3940
  /***/ (function(module, exports, __webpack_require__) {
3849
3941
 
3850
3942
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {
@@ -3853,7 +3945,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
3853
3945
 
3854
3946
  /* istanbul ignore next */
3855
3947
  if (true) {
3856
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(23)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
3948
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(25)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
3857
3949
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
3858
3950
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
3859
3951
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -3904,21 +3996,21 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
3904
3996
  return filtered.map(function(line) {
3905
3997
  if (line.indexOf('(eval ') > -1) {
3906
3998
  // Throw away eval information until we implement stacktrace.js/stackframe#8
3907
- line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
3999
+ line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(,.*$)/g, '');
3908
4000
  }
3909
- var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');
4001
+ var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(').replace(/^.*?\s+/, '');
3910
4002
 
3911
4003
  // capture and preseve the parenthesized location "(/foo/my bar.js:12:87)" in
3912
4004
  // case it has spaces in it, as the string is split on \s+ later on
3913
- var location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
4005
+ var location = sanitizedLine.match(/ (\(.+\)$)/);
3914
4006
 
3915
4007
  // remove the parenthesized location from the line, if it was matched
3916
4008
  sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;
3917
4009
 
3918
- var tokens = sanitizedLine.split(/\s+/).slice(1);
3919
- // if a location was matched, pass it to extractLocation() otherwise pop the last token
3920
- var locationParts = this.extractLocation(location ? location[1] : tokens.pop());
3921
- var functionName = tokens.join(' ') || undefined;
4010
+ // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine
4011
+ // because this line doesn't have function name
4012
+ var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);
4013
+ var functionName = location && sanitizedLine || undefined;
3922
4014
  var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];
3923
4015
 
3924
4016
  return new StackFrame({
@@ -4051,7 +4143,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
4051
4143
 
4052
4144
 
4053
4145
  /***/ }),
4054
- /* 23 */
4146
+ /* 25 */
4055
4147
  /***/ (function(module, exports, __webpack_require__) {
4056
4148
 
4057
4149
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {
@@ -4199,7 +4291,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
4199
4291
 
4200
4292
 
4201
4293
  /***/ }),
4202
- /* 24 */
4294
+ /* 26 */
4203
4295
  /***/ (function(module, exports, __webpack_require__) {
4204
4296
 
4205
4297
  "use strict";
@@ -4356,7 +4448,7 @@ module.exports = {
4356
4448
 
4357
4449
 
4358
4450
  /***/ }),
4359
- /* 25 */
4451
+ /* 27 */
4360
4452
  /***/ (function(module, exports, __webpack_require__) {
4361
4453
 
4362
4454
  "use strict";
@@ -4377,7 +4469,7 @@ module.exports = {
4377
4469
 
4378
4470
 
4379
4471
  /***/ }),
4380
- /* 26 */
4472
+ /* 28 */
4381
4473
  /***/ (function(module, exports, __webpack_require__) {
4382
4474
 
4383
4475
  "use strict";
@@ -4579,14 +4671,14 @@ module.exports = {
4579
4671
 
4580
4672
 
4581
4673
  /***/ }),
4582
- /* 27 */
4674
+ /* 29 */
4583
4675
  /***/ (function(module, exports, __webpack_require__) {
4584
4676
 
4585
4677
  "use strict";
4586
4678
 
4587
4679
 
4588
4680
  module.exports = {
4589
- version: '2.25.1',
4681
+ version: '2.26.0',
4590
4682
  endpoint: 'api.rollbar.com/api/1/item/',
4591
4683
  logLevel: 'debug',
4592
4684
  reportLevel: 'debug',
@@ -4597,7 +4689,7 @@ module.exports = {
4597
4689
 
4598
4690
 
4599
4691
  /***/ }),
4600
- /* 28 */
4692
+ /* 30 */
4601
4693
  /***/ (function(module, exports, __webpack_require__) {
4602
4694
 
4603
4695
  "use strict";
@@ -4665,7 +4757,7 @@ module.exports = {
4665
4757
 
4666
4758
 
4667
4759
  /***/ }),
4668
- /* 29 */
4760
+ /* 31 */
4669
4761
  /***/ (function(module, exports, __webpack_require__) {
4670
4762
 
4671
4763
  "use strict";
@@ -4851,16 +4943,17 @@ module.exports = Telemeter;
4851
4943
 
4852
4944
 
4853
4945
  /***/ }),
4854
- /* 30 */
4946
+ /* 32 */
4855
4947
  /***/ (function(module, exports, __webpack_require__) {
4856
4948
 
4857
4949
  "use strict";
4858
4950
 
4859
4951
 
4860
4952
  var _ = __webpack_require__(0);
4953
+ var headers = __webpack_require__(33);
4861
4954
  var scrub = __webpack_require__(4);
4862
4955
  var urlparser = __webpack_require__(2);
4863
- var domUtil = __webpack_require__(31);
4956
+ var domUtil = __webpack_require__(34);
4864
4957
 
4865
4958
  var defaults = {
4866
4959
  network: true,
@@ -5221,7 +5314,7 @@ Instrumenter.prototype.instrumentNetwork = function() {
5221
5314
  if (args[1] && args[1].headers) {
5222
5315
  // Argument may be a Headers object, or plain object. Ensure here that
5223
5316
  // we are working with a Headers object with case-insensitive keys.
5224
- var reqHeaders = new Headers(args[1].headers);
5317
+ var reqHeaders = headers(args[1].headers);
5225
5318
 
5226
5319
  metadata.request_content_type = reqHeaders.get('Content-Type');
5227
5320
 
@@ -5241,6 +5334,9 @@ Instrumenter.prototype.instrumentNetwork = function() {
5241
5334
  if (self.trackHttpErrors()) {
5242
5335
  metadata.stack = (new Error()).stack;
5243
5336
  }
5337
+
5338
+ // Start our handler before returning the promise. This allows resp.clone()
5339
+ // to execute before other handlers touch the response.
5244
5340
  return orig.apply(this, args).then(function (resp) {
5245
5341
  metadata.end_time_ms = _.now();
5246
5342
  metadata.status_code = resp.status;
@@ -5253,6 +5349,7 @@ Instrumenter.prototype.instrumentNetwork = function() {
5253
5349
  if (self.autoInstrument.networkResponseBody) {
5254
5350
  if (typeof resp.text === 'function') { // Response.text() is not implemented on some platforms
5255
5351
  // The response must be cloned to prevent reading (and locking) the original stream.
5352
+ // This must be done before other handlers touch the response.
5256
5353
  body = resp.clone().text(); //returns a Promise
5257
5354
  }
5258
5355
  }
@@ -5628,7 +5725,110 @@ module.exports = Instrumenter;
5628
5725
 
5629
5726
 
5630
5727
  /***/ }),
5631
- /* 31 */
5728
+ /* 33 */
5729
+ /***/ (function(module, exports, __webpack_require__) {
5730
+
5731
+ "use strict";
5732
+
5733
+
5734
+ /*
5735
+ * headers - Detect when fetch Headers are undefined and use a partial polyfill.
5736
+ *
5737
+ * A full polyfill is not used in order to keep package size as small as possible.
5738
+ * Since this is only used internally and is not added to the window object,
5739
+ * the full interface doesn't need to be supported.
5740
+ *
5741
+ * This implementation is modified from whatwg-fetch:
5742
+ * https://github.com/github/fetch
5743
+ */
5744
+ function headers(headers) {
5745
+ if (typeof Headers === 'undefined') {
5746
+ return new FetchHeaders(headers);
5747
+ }
5748
+
5749
+ return new Headers(headers);
5750
+ }
5751
+
5752
+ function normalizeName(name) {
5753
+ if (typeof name !== 'string') {
5754
+ name = String(name)
5755
+ }
5756
+ return name.toLowerCase()
5757
+ }
5758
+
5759
+ function normalizeValue(value) {
5760
+ if (typeof value !== 'string') {
5761
+ value = String(value)
5762
+ }
5763
+ return value
5764
+ }
5765
+
5766
+ function iteratorFor(items) {
5767
+ var iterator = {
5768
+ next: function() {
5769
+ var value = items.shift()
5770
+ return {done: value === undefined, value: value}
5771
+ }
5772
+ }
5773
+
5774
+ return iterator
5775
+ }
5776
+
5777
+ function FetchHeaders(headers) {
5778
+ this.map = {}
5779
+
5780
+ if (headers instanceof FetchHeaders) {
5781
+ headers.forEach(function(value, name) {
5782
+ this.append(name, value)
5783
+ }, this)
5784
+ } else if (Array.isArray(headers)) {
5785
+ headers.forEach(function(header) {
5786
+ this.append(header[0], header[1])
5787
+ }, this)
5788
+ } else if (headers) {
5789
+ Object.getOwnPropertyNames(headers).forEach(function(name) {
5790
+ this.append(name, headers[name])
5791
+ }, this)
5792
+ }
5793
+ }
5794
+
5795
+ FetchHeaders.prototype.append = function(name, value) {
5796
+ name = normalizeName(name)
5797
+ value = normalizeValue(value)
5798
+ var oldValue = this.map[name]
5799
+ this.map[name] = oldValue ? oldValue + ', ' + value : value
5800
+ }
5801
+
5802
+ FetchHeaders.prototype.get = function(name) {
5803
+ name = normalizeName(name)
5804
+ return this.has(name) ? this.map[name] : null
5805
+ }
5806
+
5807
+ FetchHeaders.prototype.has = function(name) {
5808
+ return this.map.hasOwnProperty(normalizeName(name))
5809
+ }
5810
+
5811
+ FetchHeaders.prototype.forEach = function(callback, thisArg) {
5812
+ for (var name in this.map) {
5813
+ if (this.map.hasOwnProperty(name)) {
5814
+ callback.call(thisArg, this.map[name], name, this)
5815
+ }
5816
+ }
5817
+ }
5818
+
5819
+ FetchHeaders.prototype.entries = function() {
5820
+ var items = []
5821
+ this.forEach(function(value, name) {
5822
+ items.push([name, value])
5823
+ })
5824
+ return iteratorFor(items)
5825
+ }
5826
+
5827
+ module.exports = headers;
5828
+
5829
+
5830
+ /***/ }),
5831
+ /* 34 */
5632
5832
  /***/ (function(module, exports, __webpack_require__) {
5633
5833
 
5634
5834
  "use strict";
@@ -5767,19 +5967,19 @@ module.exports = {
5767
5967
 
5768
5968
 
5769
5969
  /***/ }),
5770
- /* 32 */
5970
+ /* 35 */
5771
5971
  /***/ (function(module, exports, __webpack_require__) {
5772
5972
 
5773
5973
  "use strict";
5774
5974
 
5775
5975
 
5776
- var polyfillJSON = __webpack_require__(33);
5976
+ var polyfillJSON = __webpack_require__(36);
5777
5977
 
5778
5978
  module.exports = polyfillJSON;
5779
5979
 
5780
5980
 
5781
5981
  /***/ }),
5782
- /* 33 */
5982
+ /* 36 */
5783
5983
  /***/ (function(module, exports) {
5784
5984
 
5785
5985
  // json3.js
@@ -6548,7 +6748,7 @@ module.exports = setupCustomJSON;
6548
6748
 
6549
6749
 
6550
6750
  /***/ }),
6551
- /* 34 */
6751
+ /* 37 */
6552
6752
  /***/ (function(module, exports, __webpack_require__) {
6553
6753
 
6554
6754
  "use strict";
@@ -6598,7 +6798,7 @@ module.exports = wrapGlobals;
6598
6798
 
6599
6799
 
6600
6800
  /***/ }),
6601
- /* 35 */
6801
+ /* 38 */
6602
6802
  /***/ (function(module, exports, __webpack_require__) {
6603
6803
 
6604
6804
  "use strict";