Skip to content

Commit 35bce60

Browse files
committed
fix: update regex for multipart content-type parsing in multipleRangeDownloader
1 parent 6a83607 commit 35bce60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/electron-updater/src/differentialDownloader/multipleRangeDownloader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function doExecuteTasks(differentialDownloader: DifferentialDownloader, options:
9595
}
9696

9797
const contentType = safeGetHeader(response, "content-type")
98-
const m = /^multipart\/.+?(?:; boundary=(?:(?:"(.+)")|(?:([^\s]+))))$/i.exec(contentType)
98+
const m = /^multipart\/.+?\s*;\s*boundary=(?:"([^"]+)"|([^\s";]+))\s*$/i.exec(contentType)
9999
if (m == null) {
100100
reject(new Error(`Content-Type "multipart/byteranges" is expected, but got "${contentType}"`))
101101
return

0 commit comments

Comments
 (0)