Skip to content

Commit ee9d8d8

Browse files
committed
Fixes #2 gzip issue
1 parent c0221f8 commit ee9d8d8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

android/src/main/java/com/futurepress/staticserver/WebServer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ public WebServer(String localAddr, int port, File wwwroot) throws IOException {
2020
mimeTypes().put("svg", "image/svg+xml");
2121
}
2222

23+
@Override
24+
protected boolean useGzipWhenAccepted(Response r) {
25+
return super.useGzipWhenAccepted(r) && r.getStatus() != Response.Status.NOT_MODIFIED;
26+
}
2327
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
{
33
"name": "react-native-static-server",
4-
"version": "0.1.6",
4+
"version": "0.1.7",
55
"repository": "https://github.com/futurepress/react-native-static-server",
66
"description": "HTTP static file server for React Native",
77
"main": "index.js",

0 commit comments

Comments
 (0)