Comparing version 4.3.1 to 4.4.0
@@ -46,3 +46,6 @@ 'use strict'; | ||
const request = entry.request; | ||
const contentType = util.getContentType(response.content.mimeType); | ||
const contentType = util.getContentType( | ||
response.content.mimeType, | ||
request.url | ||
); | ||
const content = | ||
@@ -49,0 +52,0 @@ response.content && response.content.text ? response.content.text : ''; |
@@ -28,2 +28,10 @@ 'use strict'; | ||
const FILE_ENDINGS_MATCHERS = [ | ||
[/\.woff$/, 'font'], | ||
[/\.woff2$/, 'font'], | ||
[/\.eot$/, 'font'], | ||
[/\.ttf$/, 'font'], | ||
[/.*/, 'other'] // Always | ||
]; | ||
/** | ||
@@ -39,5 +47,11 @@ * Utilities for getting content from HAR:s. | ||
*/ | ||
getContentType: mimeType => | ||
MIME_TYPE_MATCHERS.find(matcher => matcher[0].test(mimeType))[1], | ||
getContentType: (mimeType, url) => { | ||
let type = MIME_TYPE_MATCHERS.find(matcher => matcher[0].test(mimeType))[1]; | ||
// Hack for woff that has mimetype application/octet-stream and others | ||
if (type === 'other') { | ||
return FILE_ENDINGS_MATCHERS.find(matcher => matcher[0].test(url))[1]; | ||
} else { | ||
return type; | ||
} | ||
}, | ||
getHTTPVersion: version => { | ||
@@ -44,0 +58,0 @@ if (version === 'h2' || version === 'HTTP/2.0') { |
{ | ||
"name": "pagexray", | ||
"version": "4.3.1", | ||
"version": "4.4.0", | ||
"description": "Xray your HAR file and know all about the page", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
838
0
35455
13