Skip to content

Commit

Permalink
Issue googleapis#842 - Adjusted spacing, dropped ignoreCase on compar…
Browse files Browse the repository at this point in the history
…ison
  • Loading branch information
egsavage committed Oct 20, 2019
1 parent af5b469 commit 2cc4fe7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
Expand Up @@ -334,11 +334,11 @@ public InputStream getContent() throws IOException {
try {
// gzip encoding (wrap content with GZipInputStream)
if (!returnRawInputStream
&& this.contentEncoding != null
&& (CONTENT_ENCODING_GZIP.equalsIgnoreCase(this.contentEncoding.trim())
|| CONTENT_ENCODING_XGZIP.equalsIgnoreCase(this.contentEncoding.trim()))) {
&& this.contentEncoding != null
&& (CONTENT_ENCODING_GZIP.equals(this.contentEncoding.trim())
|| CONTENT_ENCODING_XGZIP.equals(this.contentEncoding.trim()))) {
lowLevelResponseContent =
new ConsumingInputStream(new GZIPInputStream(lowLevelResponseContent));
new ConsumingInputStream(new GZIPInputStream(lowLevelResponseContent));
}
// logging (wrap content with LoggingInputStream)
Logger logger = HttpTransport.LOGGER;
Expand Down
Expand Up @@ -503,20 +503,19 @@ public void testGetContent_otherEncodingWithgzipInItsName_GzipIsNotUsed() throws
mockResponse.setContentType("text/plain");

HttpTransport transport =
new MockHttpTransport() {
new MockHttpTransport() {
@Override
public LowLevelHttpRequest buildRequest(String method, final String url)
throws IOException {
return new MockLowLevelHttpRequest() {
@Override
public LowLevelHttpRequest buildRequest(String method, final String url)
throws IOException {
return new MockLowLevelHttpRequest() {
@Override
public LowLevelHttpResponse execute() throws IOException {
return mockResponse;
}
};
public LowLevelHttpResponse execute() throws IOException {
return mockResponse;
}
};
HttpRequest request =
transport.createRequestFactory().buildHeadRequest(HttpTesting.SIMPLE_GENERIC_URL);
}
};
HttpRequest request = transport.createRequestFactory().buildHeadRequest(HttpTesting.SIMPLE_GENERIC_URL);
// If gzip was used on this response, an exception would be thrown
HttpResponse response = request.execute();
assertEquals("abcd", response.parseAsString());
Expand Down

0 comments on commit 2cc4fe7

Please sign in to comment.