Skip to content

Handle too-large requests/responses#3147

Open
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:limitStreamSizes
Open

Handle too-large requests/responses#3147
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:limitStreamSizes

Conversation

@gbrodman

@gbrodman gbrodman commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

100 MB is kind of arbitrary, but it's as good as any other limit.

D.1 numbers 1, 8, 9


This change is Reviewable

@gbrodman gbrodman requested a review from weiminyu July 16, 2026 17:24

@weiminyu weiminyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

@gbrodman gbrodman left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants