Skip to content

Commit ce113f3

Browse files
authored
Set 3 mb as limit for json responce. (docker-java#1162)
1 parent 89b80a9 commit ce113f3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/com/github/dockerjava/netty/NettyInvocationBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public <T> void get(TypeReference<T> typeReference, ResultCallback<T> resultCall
151151
HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback);
152152

153153
channel.pipeline().addLast(responseHandler);
154-
channel.pipeline().addLast(new JsonObjectDecoder());
154+
channel.pipeline().addLast(new JsonObjectDecoder(3 * 1024 * 1024));
155155
channel.pipeline().addLast(jsonResponseHandler);
156156

157157
sendRequest(requestProvider, channel);
@@ -300,7 +300,7 @@ public <T> void post(final Object entity, TypeReference<T> typeReference, final
300300
HttpResponseHandler responseHandler = new HttpResponseHandler(requestProvider, resultCallback);
301301

302302
channel.pipeline().addLast(responseHandler);
303-
channel.pipeline().addLast(new JsonObjectDecoder());
303+
channel.pipeline().addLast(new JsonObjectDecoder(3 * 1024 * 1024));
304304
channel.pipeline().addLast(jsonResponseHandler);
305305

306306
sendRequest(requestProvider, channel);
@@ -408,7 +408,7 @@ public <T> void post(TypeReference<T> typeReference, ResultCallback<T> resultCal
408408

409409
channel.pipeline().addLast(new ChunkedWriteHandler());
410410
channel.pipeline().addLast(responseHandler);
411-
channel.pipeline().addLast(new JsonObjectDecoder());
411+
channel.pipeline().addLast(new JsonObjectDecoder(3 * 1024 * 1024));
412412
channel.pipeline().addLast(jsonResponseHandler);
413413

414414
postChunkedStreamRequest(requestProvider, channel, body);

0 commit comments

Comments
 (0)