Browse Source

fix(DownloaderBase): head request follows redirects

evshiron 7 years ago
parent
commit
7f9dcfd6d6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/lib/common/DownloaderBase.ts

+ 3 - 1
src/lib/common/DownloaderBase.ts

@@ -106,7 +106,9 @@ export abstract class DownloaderBase {
 
     protected getRemoteSize(url: string): Promise<number> {
         return new Promise((resolve, reject) => {
-            request.head(url)
+            request.head(url, {
+                followAllRedirects: true,
+            })
             .on('error', reject)
             .on('response', res => resolve(parseInt(<string>(res.headers['content-length']), 10)));
         });