2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-14 18:42:33 +03:00

Adding X-Requested-With header

This commit is contained in:
mzabriskie
2015-04-12 16:07:32 -06:00
parent a517a23982
commit 1629a026da
3 changed files with 127 additions and 98 deletions
+3
View File
@@ -25,6 +25,9 @@ module.exports = function xhrAdapter(resolve, reject, config) {
config.headers || {}
);
// Indicate that request is being made with XHR
requestHeaders['X-Requested-With'] = 'XMLHttpRequest';
if (utils.isFormData(data)) {
delete requestHeaders['Content-Type']; // Let the browser set it
}