mirror of
https://github.com/actions/toolkit.git
synced 2026-08-16 00:00:21 +02:00
Parse the mime type out of the content-type header
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
co-authored by
Copilot
parent
9700641a19
commit
3d9761876c
@@ -80,10 +80,11 @@ export async function streamExtractExternal(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const contentType = response.message.headers['content-type'] || ''
|
const contentType = response.message.headers['content-type'] || ''
|
||||||
|
const mimeType = contentType.split(';', 1)[0].trim().toLowerCase()
|
||||||
const isZip =
|
const isZip =
|
||||||
contentType === 'application/zip' ||
|
mimeType === 'application/zip' ||
|
||||||
contentType === 'application/x-zip-compressed' ||
|
mimeType === 'application/x-zip-compressed' ||
|
||||||
contentType === 'zip'
|
mimeType === 'zip'
|
||||||
|
|
||||||
// Extract filename from Content-Disposition header
|
// Extract filename from Content-Disposition header
|
||||||
const contentDisposition =
|
const contentDisposition =
|
||||||
|
|||||||
Reference in New Issue
Block a user