mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 08:13:43 +01:00
Added the Accept-Encoding header to speed up downloads
Former-commit-id: 669fed48dcf120c5a1bef0e6073e0107afd0db4a
This commit is contained in:
@@ -31,6 +31,7 @@ import java.net.URL;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
|
||||
/**
|
||||
* A utility to download files from the Internet.
|
||||
@@ -129,8 +130,10 @@ public class Downloader {
|
||||
BufferedOutputStream writer = null;
|
||||
try {
|
||||
InputStream reader;
|
||||
if (unzip) {
|
||||
if (unzip || (encoding != null && "gzip".equalsIgnoreCase(encoding))) {
|
||||
reader = new GZIPInputStream(conn.getInputStream());
|
||||
} else if (encoding != null && "deflate".equalsIgnoreCase(encoding)) {
|
||||
reader = new InflaterInputStream(conn.getInputStream());
|
||||
} else {
|
||||
reader = conn.getInputStream();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user