Skip to content

Commit

Permalink
Decrease JS RPC message limit to 1MiB
Browse files Browse the repository at this point in the history
  • Loading branch information
MellowYarker committed Jan 15, 2024
1 parent e679f3f commit da90341
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/workerd/api/worker-rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@

namespace workerd::api {

// TODO(soon): This size limit is loosely based on Cap'n Proto's 'traversalLimitInWords'.
// JS RPC does not support streaming messages yet, and until it does we should prevent
// large messages from being sent.
constexpr size_t MAX_JS_RPC_MESSAGE_SIZE = 32 * 1024 * 1024;
// TODO(soon): JS RPC does not support streaming messages yet. Until it does, we should prevent
// large messages from being sent. This limits rpc messages to the same size as a WebSocket message.
constexpr size_t MAX_JS_RPC_MESSAGE_SIZE = 1u << 20;

// A WorkerRpc object forwards JS method calls to the remote Worker/Durable Object over RPC.
// Since methods are not known until runtime, WorkerRpc doesn't define any JS methods.
Expand Down

0 comments on commit da90341

Please sign in to comment.