mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
merge with branch issue-109
This commit is contained in:
@@ -251,7 +251,8 @@ public class URLHttpClient implements HttpClient
|
||||
{
|
||||
String url = createGetUrl(request.getUrl(), request.getParameters());
|
||||
|
||||
return new URLHttpResponse(openConnection(request, url));
|
||||
return new URLHttpResponse(openConnection(request, url),
|
||||
request.isDecodeGZip());
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
@@ -70,8 +70,21 @@ public class URLHttpResponse implements HttpResponse
|
||||
* @param connection
|
||||
*/
|
||||
public URLHttpResponse(URLConnection connection)
|
||||
{
|
||||
this(connection, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
*
|
||||
* @param connection
|
||||
* @param decodeGZip
|
||||
*/
|
||||
public URLHttpResponse(URLConnection connection, boolean decodeGZip)
|
||||
{
|
||||
this.connection = connection;
|
||||
this.decodeGZip = decodeGZip;
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
@@ -114,7 +127,7 @@ public class URLHttpResponse implements HttpResponse
|
||||
String enc = connection.getContentEncoding();
|
||||
InputStream input = null;
|
||||
|
||||
if (Util.isNotEmpty(enc) && enc.contains(ENCODING_GZIP))
|
||||
if (decodeGZip || (Util.isNotEmpty(enc) && enc.contains(ENCODING_GZIP)))
|
||||
{
|
||||
input = new GZIPInputStream(connection.getInputStream());
|
||||
}
|
||||
@@ -215,8 +228,11 @@ public class URLHttpResponse implements HttpResponse
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private boolean clientClose = false;
|
||||
private URLConnection connection;
|
||||
|
||||
/** Field description */
|
||||
private URLConnection connection;
|
||||
private boolean decodeGZip = false;
|
||||
|
||||
/** Field description */
|
||||
private boolean clientClose = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user