diff --git a/examples/post/index.html b/examples/post/index.html index 510ffa0..5d8e670 100644 --- a/examples/post/index.html +++ b/examples/post/index.html @@ -10,7 +10,7 @@
@@ -24,9 +24,7 @@ document.getElementById('post').onclick = function () { var data = document.getElementById('data').value; - axios.post('/post/server', data,{ - xDomain : true - },JSON.parse(data)) + axios.post('/post/server', JSON.parse(data)) .then(function (res) { output.className = 'container'; output.innerHTML = res.data; diff --git a/examples/server.js b/examples/server.js index dce5943..525fb63 100644 --- a/examples/server.js +++ b/examples/server.js @@ -76,7 +76,6 @@ dirs = listDirs(__dirname); server = http.createServer(function (req, res) { var url = req.url; - res.setHeader("Access-Control-Allow-Origin", "*"); // Process axios itself if (/axios\.min\.js$/.test(url)) { diff --git a/lib/axios.js b/lib/axios.js index c4d3431..5c2727a 100644 --- a/lib/axios.js +++ b/lib/axios.js @@ -5,8 +5,6 @@ var utils = require('./utils'); var dispatchRequest = require('./core/dispatchRequest'); var InterceptorManager = require('./core/InterceptorManager'); -require('es6-promise').polyfill(); - function Axios (defaultConfig) { this.defaultConfig = utils.merge({ headers: {}, diff --git a/test/specs/requests.spec.js b/test/specs/requests.spec.js index a8eec10..a78918e 100644 --- a/test/specs/requests.spec.js +++ b/test/specs/requests.spec.js @@ -59,7 +59,8 @@ describe('requests', function () { axios({ method: 'post', - url: 'www.someurl.com/foo' + url: 'www.someurl.com/foo', + xDomain: true }).then(function(res){ response = res; });