| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -409,8 +409,9 @@ public void readResponseStream(HttpURLConnection connection, Stack<Closeable> op | |||
| 409 | 409 | ||
| 410 | 410 | // In the event we don't have a null stream, and we have gzip as part of the encoding | |
| 411 | 411 | // then we will use gzip to decode the stream | |
| 412 | + // Ignore gzip encoding for 204 'No Content' status to prevent java.io.EOFException | ||
| 412 | 413 | String encodingHeader = connection.getHeaderField("Content-Encoding"); | |
| 413 | - if (encodingHeader != null && encodingHeader.toLowerCase().contains("gzip")) { | ||
| 414 | + if (encodingHeader != null && encodingHeader.toLowerCase().contains("gzip") && this.statusCode != 204) { | ||
| 414 | 415 | inStream = new GZIPInputStream(inStream); | |
| 415 | 416 | } | |
| 416 | 417 | ||
@@ -584,4 +585,4 @@ private void closeOpenedStreams(Stack<Closeable> streams) throws IOException { | |||
| 584 | 585 | } | |
| 585 | 586 | } | |
| 586 | 587 | } | |
| 587 | - } | ||
| 588 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments