message: Guard against missing headers in FileDownloader
diff: @@ -59,13 +59,21 @@ async function downloadFile(description: string, urlString: string, eventStream:
  let request = https.request(options, response => {
  if (response.statusCode === 301 || response.statusCode === 302) {
  // Redirect - download from new location
  + if (response.headers.location === undefined) {
  + eventStream.post(new DownloadFailure(`Failed to download from ${urlString}. Redirected without location header`));
  + return reject(new NestedError('Missing location'));
  + }
  return resolve(downloadFile(description, response.headers.location, eventStream, networkSettingsProvider));
  }
  -
  - else if (response.statusCode != 200) {
  + else if (response.statusCode !== 200) {
  // Download failed - print error message
  eventStream.post(new DownloadFailure(`Failed to download from ${urlString}. Error code '${response.statusCode}')`));
  - return reject(new NestedError(response.statusCode.toString()));
  + return reject(new NestedError(response.statusCode!.toString())); // Known to exist because this is from a ClientRequest
  + }
  +
  + if (response.headers['content-length'] === undefined) {
  + eventStream.post(new DownloadFailure(`Failed to download from ${urlString}. No content-length header`));
  + return reject(new NestedError('Missing content-length'));
  }
  // Downloading - hook up events
  