mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Only use if it's a function
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle progress if needed
|
// Handle progress if needed
|
||||||
if (config.progress) {
|
if (typeof config.progress === 'function') {
|
||||||
if (config.method === 'post' || config.method === 'put') {
|
if (config.method === 'post' || config.method === 'put') {
|
||||||
request.upload.addEventListener('progress', config.progress);
|
request.upload.addEventListener('progress', config.progress);
|
||||||
} else if (config.method === 'get') {
|
} else if (config.method === 'get') {
|
||||||
|
|||||||
Reference in New Issue
Block a user