Commit d95a01b9 by Ryan Baxter

Compatibility with Java 1.7 when cherry picking 50924f29

parent b9bfd4fb
......@@ -63,7 +63,7 @@ public class SendResponseFilter extends ZuulFilter {
this(new ZuulProperties());
}
public SendResponseFilter(ZuulProperties zuulProperties) {
public SendResponseFilter(final ZuulProperties zuulProperties) {
this.zuulProperties = zuulProperties;
// To support Servlet API 3.1 we need to check if setContentLengthLong exists
try {
......@@ -72,7 +72,12 @@ public class SendResponseFilter extends ZuulFilter {
} catch(NoSuchMethodException e) {
useServlet31 = false;
}
buffers = ThreadLocal.withInitial(() -> new byte[zuulProperties.getInitialStreamBufferSize()]);
buffers = new ThreadLocal<byte[]>(){
@Override
public byte[] get() {
return new byte[zuulProperties.getInitialStreamBufferSize()];
}
};
}
/* for testing */ boolean isUseServlet31() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment