fetch response headers malformed (Tabris-js 2.0.0-beta1)
See original GitHub issueWhile 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)}}
Issue Analytics
- State:
- Created 7 years ago
- Comments:22 (22 by maintainers)
Top Results From Across the Web
XHR filters multiple HTTP response headers of the same type · Issue ...
If an XHR response contains multiple HTTP headers of the same type, only one of them is ... fetch response headers malformed (Tabris-js...
Read more >Fetch response malformed - javascript - Stack Overflow
The issue is basically that the fetch response object is not correct. ... headers: new Headers({ 'Authorization': 'Bearer ' + this.token, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
I’m closing this issue as it’s related to the old implementation that used a polyfill.