From 7a12f3660270c16e239e1862b7b65a5140f3ea0f Mon Sep 17 00:00:00 2001 From: Matt Zabriskie Date: Thu, 23 Jun 2016 13:59:03 -0600 Subject: [PATCH] Only use if it's a function --- lib/adapters/xhr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 2cfc31a..0f19802 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -143,7 +143,7 @@ module.exports = function xhrAdapter(resolve, reject, config) { } // Handle progress if needed - if (config.progress) { + if (typeof config.progress === 'function') { if (config.method === 'post' || config.method === 'put') { request.upload.addEventListener('progress', config.progress); } else if (config.method === 'get') {