Skip to content

Commit d68d621

Browse files
author
p01
committed
Added the "text/plain" fall back mimetype and decodeURICompent() as per RFC 2397
Fixed the ellisping of not so short distinguishers
1 parent a91fa27 commit d68d621

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/network/network_service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,10 +1310,10 @@ cls.ResourceInfo = function(entry)
13101310
var is_base64 = data.lastIndexOf(";base64", pos) != -1;
13111311

13121312
this.data = {};
1313-
this.data.mimeType = data.slice(0, is_base64 ? data.indexOf(";") : pos);
1313+
this.data.mimeType = data.slice(0, is_base64 ? data.indexOf(";") : pos) || "text/plain";
13141314
this.data.content = {};
13151315
if (this.data.mimeType.startswith("text/"))
1316-
this.data.content.stringData = is_base64 ? atob(data.slice(pos + 1)) : data.slice(pos + 1);
1316+
this.data.content.stringData = is_base64 ? atob(data.slice(pos + 1)) : decodeURIComponent(data.slice(pos + 1));
13171317
else
13181318
this.data.content.stringData = entry.url;
13191319
this.data.content.length = this.data.content.stringData.length;

src/resource-manager/resource_templates.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ window.templates.resource_tree || (window.templates.resource_tree = new function
1313
{
1414
var name = url.short_distinguisher;
1515

16-
if (name.length > this.DISTINGUISHER_MAX_LENGTH)
17-
name = name.slice(0, this.DISTINGUISHER_MAX_LENGTH) + "…";
16+
if (name.length > DISTINGUISHER_MAX_LENGTH)
17+
name = name.slice(0, DISTINGUISHER_MAX_LENGTH) + "…";
1818

1919
return name;
2020
};
@@ -128,7 +128,7 @@ window.templates.resource_tree || (window.templates.resource_tree = new function
128128
"data-tooltip-text", d.original_url
129129
],
130130
" ",
131-
d.same_origin ? [] : ["span", d.url.host, "class", "resource-domain"],
131+
d.same_origin ? [] : ["span", d.url.host || d.url.protocol, "class", "resource-domain"],
132132
" ",
133133
["span",
134134
String(resources.length),

0 commit comments

Comments
 (0)