Skip to content

Commit

Permalink
head support
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofrancis committed Aug 17, 2020
1 parent baf9311 commit 7291ce8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ class DownloadManagerImpl(private val httpDownloader: Downloader<*, *>,
}

private fun getFileDownloader(download: Download, downloader: Downloader<*, *>): FileDownloader {
val request = getRequestForDownload(download)
val originalRequest = getRequestForDownload(download)
val request = if (downloader.getHeadRequestMethodSupported(originalRequest)) {
getRequestForDownload(download, HEAD_REQUEST_METHOD)
} else {
originalRequest
}
val supportedDownloadTypes = downloader.getRequestSupportedFileDownloaderTypes(request)
return if (downloader.getRequestFileDownloaderType(request, supportedDownloadTypes) == Downloader.FileDownloaderType.SEQUENTIAL) {
SequentialFileDownloaderImpl(
Expand Down

0 comments on commit 7291ce8

Please sign in to comment.