Skip to content

Commit

Permalink
Merge pull request #351 from praserocking/master
Browse files Browse the repository at this point in the history
If ContentType header has 'json' in it, then the response will be GZIPed
  • Loading branch information
LordFokas committed Aug 10, 2016
2 parents 73b093c + d2c6a64 commit a4d62f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/fi/iki/elonen/NanoHTTPD.java
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ protected static String decodePercent(String str) {
*/
@SuppressWarnings("static-method")
protected boolean useGzipWhenAccepted(Response r) {
return r.getMimeType() != null && r.getMimeType().toLowerCase().contains("text/");
return r.getMimeType() != null && (r.getMimeType().toLowerCase().contains("text/") || r.getMimeType().toLowerCase().contains("/json"));
}

public final int getListeningPort() {
Expand Down

0 comments on commit a4d62f0

Please sign in to comment.