Skip to content

Commit

Permalink
chore: response may not have headers
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Jan 9, 2025
1 parent c229227 commit 380a848
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/dts-plugin/src/core/lib/archiveHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ export const downloadTypesArchive = (hostOptions: Required<HostOptions>) => {
const response = await axiosGet(url, {
responseType: 'arraybuffer',
}).catch(downloadErrorLogger(destinationFolder, url));
debugger;
if (
typeof response.headers['content-type'] === 'string' &&
typeof response.headers?.['content-type'] === 'string' &&
response.headers['content-type'].includes('text/html')
) {
console.log(11111111, response.headers['content-type']);
throw new Error(
`${url} receives invalid content-type: ${response.headers['content-type']}`,
);
Expand Down

0 comments on commit 380a848

Please sign in to comment.