提交 03f29117 编写于 作者: M Matt Zabriskie

Merge branch 'master' of github.com:mzabriskie/axios

......@@ -76,6 +76,17 @@ module.exports = function xhrAdapter(resolve, reject, config) {
request = null;
};
// Handle timeout
request.ontimeout = function handleTimeout() {
var err = new Error('timeout of ' + config.timeout + 'ms exceeded');
err.timeout = config.timeout;
err.code = 'ECONNABORTED';
reject(err);
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册