tabris-js: fetch response headers malformed (Tabris-js 2.0.0-beta1)

While getting a fetch response, I noticed the Authorization can no longer be obtained form the headers.

In Tabris-js version 1.10 my response object looked like this:

  {set:function (a,d){this.map[b(a)]=[c(d)]}, has:function (a){return this.map.hasOwnProperty(b(a))}, map:{content-type:["application/json"], authorization:["eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2JvbHQtYXBpLnJvY2tldG1lbi5pby9hcGkvYXV0aC9sb2dpbiIsImlhdCI6MTQ4ODE5NjQ1MywiZXhwIjoxNTE5NzMyNDUzLCJuYmYiOjE0ODgxOTY0NTMsImp0aSI6Ik1jeXpycVdOWVRGVzFOM0siLCJzdWIiOjF9.7FTeMf7mbFw1i4rBgPUGC5t7qFjCww28C41aO7ldZx4"], x-ratelimit-reset:["1488196513"], content-encoding:["gzip"], server:["nginx"], transfer-encoding:["Identity"], cache-control:["private, must-revalidate"], date:["Mon, 27 Feb 2017 11:54:13 GMT"], strict-transport-security:["max-age=31536000; includeSubdomains"], x-ratelimit-remaining:["49"], connection:["keep-alive"], x-ratelimit-limit:["50"], etag:["W/"639df0b84fe699b4a290a713fd6b9a94bd4deb95""], vary:["Accept-Encoding"], x-frame-options:["SAMEORIGIN"]}, get:function (a){var c=this.map[b(a)];return c?c[0]:null}, append:function (a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)}, getAll:function (a){return this.map[b(a)]||[]}, delete:function (a){delete this.map[b(a)]}, forEach:function (a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)}}

However, after an upgrade to Tabris-js 2.0.0-beta1 I have discovered a breakage in the array of headers, notice no closing square bracket after content-type:["application/json but instead line breaks

{set:function (a,d){this.map[b(a)]=[c(d)]}, has:function (a){return this.map.hasOwnProperty(b(a))}, map:{content-type:["application/json

  Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2JvbHQtYXBpLnJvY2tldG1lbi5pby9hcGkvYXV0aC9sb2dpbiIsImlhdCI6MTQ4ODE5NjExNywiZXhwIjoxNTE5NzMyMTE3LCJuYmYiOjE0ODgxOTYxMTcsImp0aSI6IjdGd3V1TFZpazNsT29LS1MiLCJzdWIiOjF9.ZKAhF5eCC-Tdo3-GPcxsu7OBiRkUFc_ktgYXhVImaog

  X-RateLimit-Reset: 1488196177

  Content-Encoding: gzip

  Server: nginx

  Transfer-Encoding: Identity

  Cache-Control: private, must-revalidate

  Date: Mon, 27 Feb 2017 11:48:37 GMT

  Strict-Transport-Security: max-age=31536000; includeSubdomains

  X-RateLimit-Remaining: 49

  Connection: keep-alive

  X-RateLimit-Limit: 50

  Etag: W/"639df0b84fe699b4a290a713fd6b9a94bd4deb95"

  Vary: Accept-Encoding

  X-Frame-Options: SAMEORIGIN"]}, get:function (a){var c=this.map[b(a)];return c?c[0]:null}, append:function (a,d){a=b(a),d=c(d);var e=this.map[a];e||(e=[],this.map[a]=e),e.push(d)}, getAll:function (a){return this.map[b(a)]||[]}, delete:function (a){delete this.map[b(a)]}, forEach:function (a,b){Object.getOwnPropertyNames(this.map).forEach(function(c){this.map[c].forEach(function(d){a.call(b,d,c,this)},this)},this)}, keys:function (){var a=[];return this.forEach(function(b,c){a.push(c)}),d(a)}, values:function (){var a=[];return this.forEach(function(b){a.push(b)}),d(a)}, entries:function (){var a=[];return this.forEach(function(b,c){a.push([c,b])}),d(a)}}

Can it be related to @ralfstx’s issue: #914?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

Sure. I’m about to go to bed. But tomorrow I’ll see if I can set up an example. Perhaps using an oath service, and a snippet in my Tabris account that we can run against the two different Tabris versions