diff --git a/README.md b/README.md index dab106f..a915d51 100644 --- a/README.md +++ b/README.md @@ -189,13 +189,13 @@ const axios = require('axios/dist/browser/axios.cjs'); // browser commonJS bundl Using jsDelivr CDN (ES5 UMD browser module): ```html - + ``` Using unpkg CDN: ```html - + ``` ## Example diff --git a/examples/get/server.js b/examples/get/server.js index 8a3622f..7312f42 100644 --- a/examples/get/server.js +++ b/examples/get/server.js @@ -27,7 +27,7 @@ const people = [ export default function (req, res) { res.writeHead(200, { - 'Content-Type': 'text/json' + 'Content-Type': 'application/json' }); res.write(JSON.stringify(people)); res.end(); diff --git a/examples/post/server.js b/examples/post/server.js index 1cb9c45..68756d1 100644 --- a/examples/post/server.js +++ b/examples/post/server.js @@ -8,7 +8,7 @@ export default function (req, res) { req.on('end', function () { console.log('POST data received'); res.writeHead(200, { - 'Content-Type': 'text/json' + 'Content-Type': 'application/json' }); res.write(JSON.stringify(data)); res.end(); diff --git a/examples/postMultipartFormData/server.js b/examples/postMultipartFormData/server.js index 9db463e..eb95af6 100644 --- a/examples/postMultipartFormData/server.js +++ b/examples/postMultipartFormData/server.js @@ -6,7 +6,7 @@ export default function (req, res) { req.on('end', function () { console.log('POST received'); res.writeHead(200, { - 'Content-Type': 'text/json' + 'Content-Type': 'application/json' }); res.end(); }); diff --git a/lib/helpers/composeSignals.js b/lib/helpers/composeSignals.js index 84087c8..cf27ddf 100644 --- a/lib/helpers/composeSignals.js +++ b/lib/helpers/composeSignals.js @@ -21,7 +21,7 @@ const composeSignals = (signals, timeout) => { let timer = timeout && setTimeout(() => { timer = null; - onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)) + onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT)) }, timeout) const unsubscribe = () => { diff --git a/test/unit/helpers/composeSignals.js b/test/unit/helpers/composeSignals.js index 961921e..89cfa11 100644 --- a/test/unit/helpers/composeSignals.js +++ b/test/unit/helpers/composeSignals.js @@ -32,7 +32,7 @@ describe('helpers::composeSignals', () => { signal.addEventListener('abort', resolve); }); - assert.match(String(signal.reason), /timeout 100 of ms exceeded/); + assert.match(String(signal.reason), /timeout of 100ms exceeded/); }); it('should return undefined if signals and timeout are not provided', async () => {