Handle too-large requests/responses#3147
Conversation
weiminyu
left a comment
There was a problem hiding this comment.
@weiminyu reviewed 12 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on gbrodman).
core/src/main/java/google/registry/request/UrlConnectionUtils.java line 40 at r1 (raw file):
public final class UrlConnectionUtils { public static final int MAX_PAYLOAD_BYTES = 50 * 1024 * 1024;
Rename to MAX_RESPONSE_PAYLOAD_BYTES to differentiate from the other variable in RequestModule?
Also, maybe increase this to 100M? The smdrl file is about 15M and is getting bigger over time.
Code quote:
MAX_PAYLOAD_BYTES = 50 * 1024 * 1024;core/src/main/java/google/registry/request/UrlConnectionUtils.java line 54 at r1 (raw file):
public static byte[] getResponseBytes(HttpURLConnection connection) throws IOException { try { if (connection.getContentLengthLong() > MAX_PAYLOAD_BYTES) {
Maybe add a severe log if payload size is within 90% of the limit?
Code quote:
if (connection.getContentLengthLong() > MAX_PAYLOAD_BYTES)100 MB is kind of arbitrary, but it's as good as any other limit. D.1 numbers 1, 8, 9
1306193 to
3688fa1
Compare
gbrodman
left a comment
There was a problem hiding this comment.
@gbrodman made 2 comments.
Reviewable status: 10 of 12 files reviewed, 2 unresolved discussions (waiting on weiminyu).
core/src/main/java/google/registry/request/UrlConnectionUtils.java line 40 at r1 (raw file):
Previously, weiminyu (Weimin Yu) wrote…
Rename to MAX_RESPONSE_PAYLOAD_BYTES to differentiate from the other variable in RequestModule?
Also, maybe increase this to 100M? The smdrl file is about 15M and is getting bigger over time.
Makes sense! Done.
core/src/main/java/google/registry/request/UrlConnectionUtils.java line 54 at r1 (raw file):
Previously, weiminyu (Weimin Yu) wrote…
Maybe add a severe log if payload size is within 90% of the limit?
Done.
100 MB is kind of arbitrary, but it's as good as any other limit.
D.1 numbers 1, 8, 9
This change is