diff --git a/axios/axios-tests.ts b/axios/axios-tests.ts index a321e97f19..eb98e2710c 100644 --- a/axios/axios-tests.ts +++ b/axios/axios-tests.ts @@ -80,7 +80,11 @@ var axiosInstance = axios.create({ timeout: 1000 }); -axiosInstance.request({url: "issues/1"}); +axiosInstance.request({url: "issues/1"}).then(res => { + if (res.headers['content-type'].startsWith('application/json')) { + throw new Error('Unexpected content-type'); + } +}); axios.all([getRepoDetails, getRepoDetails]).then(([repo1, repo2]) => { var sumIds = repo1.data.id + repo2.data.id; diff --git a/axios/index.d.ts b/axios/index.d.ts index a2c5bfbd45..d66dc3d48c 100644 --- a/axios/index.d.ts +++ b/axios/index.d.ts @@ -159,7 +159,7 @@ declare namespace Axios { /** * headers that the server responded with */ - headers: Object; + headers: {[index: string]: any}; /** * config that was provided to `axios` for the request