aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/web/OverrideFilter.java4
-rw-r--r--src/main/java/org/traccar/web/ResponseWrapper.java (renamed from src/main/java/org/traccar/web/CharResponseWrapper.java)4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/web/OverrideFilter.java b/src/main/java/org/traccar/web/OverrideFilter.java
index 708632bc1..e6e02514c 100644
--- a/src/main/java/org/traccar/web/OverrideFilter.java
+++ b/src/main/java/org/traccar/web/OverrideFilter.java
@@ -45,12 +45,12 @@ public class OverrideFilter implements Filter {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
- CharResponseWrapper wrappedResponse = new CharResponseWrapper((HttpServletResponse) response);
+ ResponseWrapper wrappedResponse = new ResponseWrapper((HttpServletResponse) response);
chain.doFilter(request, wrappedResponse);
byte[] bytes = wrappedResponse.getCapture();
- if (wrappedResponse.getContentType().contains("text/html")
+ if (wrappedResponse.getContentType() != null && wrappedResponse.getContentType().contains("text/html")
|| ((HttpServletRequest) request).getPathInfo().endsWith("manifest.json")) {
Server server;
diff --git a/src/main/java/org/traccar/web/CharResponseWrapper.java b/src/main/java/org/traccar/web/ResponseWrapper.java
index 477fe7928..7c06b67b8 100644
--- a/src/main/java/org/traccar/web/CharResponseWrapper.java
+++ b/src/main/java/org/traccar/web/ResponseWrapper.java
@@ -22,12 +22,12 @@ import javax.servlet.http.HttpServletResponseWrapper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-public class CharResponseWrapper extends HttpServletResponseWrapper {
+public class ResponseWrapper extends HttpServletResponseWrapper {
private final ByteArrayOutputStream capture;
private ServletOutputStream output;
- public CharResponseWrapper(HttpServletResponse response) {
+ public ResponseWrapper(HttpServletResponse response) {
super(response);
capture = new ByteArrayOutputStream(response.getBufferSize());
}