Skip to content

Commit

Permalink
pragma: no-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
annmuor committed Feb 3, 2014
1 parent 017aca9 commit 0806eda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public CharsetFilter() {
public void handle(Request request, Response response) {
if (request.pathInfo().endsWith(".html")) {
response.type("text/html; charset=utf-8");
response.header("Cache-Control",
"no-cache, no-store, must-revalidate");
response.header("Pragma", "no-cache");
response.header("Expires", "0");
}
}

Expand Down
5 changes: 3 additions & 2 deletions jnode-httpd-module/src/org/jnode/httpd/util/HTML.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import jnode.ftn.FtnTools;

public class HTML {
private static final int MAX_SIZE = 65535;
private static String header = null;
private static String footer = null;
private static String menu = null;
Expand Down Expand Up @@ -72,15 +73,15 @@ public static String getContents(String path) {
String search = "www" + path;
InputStream is = Thread.currentThread().getContextClassLoader()
.getResourceAsStream(search);
byte[] buf = new byte[MAX_SIZE];
if (is != null) {
StringBuilder sb = new StringBuilder();
try {
int n = 0;
do {
byte[] buf = new byte[1024];
n = is.read(buf);
if (n > 0) {
sb.append(new String(buf, 0, n));
sb.append(new String(buf, 0, n, "UTF-8"));
}
} while (n > 0);
is.close();
Expand Down

0 comments on commit 0806eda

Please sign in to comment.