N0taN3rd / wail

:whale2: One-Click User Instigated Preservation
http://matkelly.com/wail
GNU General Public License v3.0
121 stars 9 forks source link

Download-externals script throws exception #104

Open machawk1 opened 5 years ago

machawk1 commented 5 years ago

Are you submitting a bug report or a feature request?

Bug in build process.

What is the current behavior?

I am trying to build WAIL-Electron on macOS 10.12.4. One step in resolving dependencies is to npm run download-externals. The downloadMemgator() function appears to be reused to download a JDK.

An issue occurs when https://bitbucket.org/alexkasko/openjdk-unofficial-builds/downloads/openjdk-1.7.0-u80-unofficial-macosx-x86_64-image.zip is passed as the URI parameter to this function.

A regex reads the content-disposition response header, whose value is attachment; filename="openjdk-1.7.0-u80-unofficial-macosx-x86_64-image.zip" for me and the regex a few lines earlier of ['a-zA-z;\s]+=([a-zA-z0-9.-]+) does not match

This causes let name = namrex.exec(res.headers[ 'content-disposition' ])[ 1 ] to fail, as amrex.exec(res.headers[ 'content-disposition' ]) does not produce any matches and the result selection (array element 1) causes the build failure.

What is the expected behavior?

Regex matches, dependency met, build can proceed. This logic of expecting consistent headers from a server is dangerous.

What's your environment?

macOS 10.12.4, , node v10.12.0, WAIL 36edc9265f99e923ffbcc211981c1f0cfcef250f (a relatively recent master)