diff --git a/core/modules/requestsMonitor/requestsMonitor.js b/core/modules/requestsMonitor/requestsMonitor.js index e654cf9de..ec161d9b4 100644 --- a/core/modules/requestsMonitor/requestsMonitor.js +++ b/core/modules/requestsMonitor/requestsMonitor.js @@ -167,6 +167,7 @@ exports.module = function(phantomas) { case 'content-type': // parse header value var value = header.value.split(';').shift().toLowerCase(); + entry.contentType = value; switch(value) { case 'text/html': @@ -195,6 +196,7 @@ exports.module = function(phantomas) { case 'image/jpeg': case 'image/gif': case 'image/svg+xml': + case 'image/webp': entry.type = 'image'; entry.isImage = true; break; diff --git a/test/modules/requestsMonitor-test.js b/test/modules/requestsMonitor-test.js index be61cfedd..b1c676448 100644 --- a/test/modules/requestsMonitor-test.js +++ b/test/modules/requestsMonitor-test.js @@ -102,6 +102,10 @@ vows.describe('requestMonitor').addBatch({ 'isBase64 is set': assertField('isBase64', true) }, }).addBatch({ + 'content type is properly passed': { + topic: recvContentType('text/html'), + 'entry.contentType is set': assertField('contentType', 'text/html') + }, 'HTML is properly detected': { topic: recvContentType('text/html'), 'isHTML is set': assertField('isHTML', true) @@ -134,6 +138,10 @@ vows.describe('requestMonitor').addBatch({ topic: recvContentType('image/svg+xml'), 'isImage is set': assertField('isImage', true) }, + 'WEBP image is properly detected': { + topic: recvContentType('image/webp'), + 'isImage is set': assertField('isImage', true) + }, 'Web font is properly detected (via MIME)': { topic: recvContentType('application/font-woff'), 'isWebFont is set': assertField('isWebFont', true)