title: Using flutter_downloader with flutter_inappwebview - Response with redirection code
body: <p>My Flutter app allows user to access a webpage which requires authentication via Flutter <a href="https://pub.dev/packages/flutter_inappwebview" rel="nofollow noreferrer">InAppWebView</a>. The webpage allows authenticated user to download a PDF file so I handle the download using the <a href="https://pub.dev/packages/flutter_downloader" rel="nofollow noreferrer">FlutterDownloader</a> in the onDownloadStart event of InAppWebView.</p>
  <p>When I try to download the file after logging onto the webpage, the app downloads the Index page of the website instead of the PDF file. Checking the debug logs reveals that the URL was redirected to the login URL:</p>
  <pre><code>D/DownloadWorker(15942): Open connection to [PDF URL]
  D/DownloadWorker(15942): Response with redirection code
  D/DownloadWorker(15942): Location = [Index path]
  D/DownloadWorker(15942): New url: [Index page URL]
  D/DownloadWorker(15942): Open connection to [Index page URL]
  D/DownloadWorker(15942): Headers = {&quot;authorization&quot;: &quot;Basic [Auth-token]&quot;,&quot;connection&quot;: &quot;keep-alive&quot;}
  D/DownloadWorker(15942): Content-Type = text/html; charset=utf-8
  D/DownloadWorker(15942): Content-Length = -1
  D/DownloadWorker(15942): Charset = UTF-8
  D/DownloadWorker(15942): Content-Disposition = null
  D/DownloadWorker(15942): fileName = Index
  D/DownloadWorker(15942): Update notification: {notificationId: 22, title: Index, status: 2, progress: -409600}
  D/DownloadWorker(15942): There's no application that can open the file /storage/emulated/0/Download/Index (16)
  D/DownloadWorker(15942): Update too frequently!!!!, but it is the final update, we should sleep a second to ensure the update call can be processed
  D/DownloadWorker(15942): Update notification: {notificationId: 22, title: Index, status: 3, progress: 100}
  D/DownloadWorker(15942): File downloaded
  I/WM-WorkerWrapper(15942): Worker result SUCCESS for Work [ id=8e03335b-c319-445e-8622-d22bacf34568, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ]
  </code></pre>
  <p>I tried saving the cookies and downloading the file using http package but it still get's redirected. I need to allow user to download the PDF file from the current webview.</p>
  <p>Any suggestion to resolve the issue would be appreciated.</p>
  <p>Thank you.</p>