gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.53k stars 377 forks source link

GWT 2.12 CSP RPC escapeString 64KB limit #10043

Closed codeart1st closed 1 week ago

codeart1st commented 1 week ago

GWT version: 2.12.0


Description

https://github.com/gwtproject/gwt/blob/c2229e7557450cd2842269f5fe9cb8586e90b50c/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java#L443-L451 https://github.com/gwtproject/gwt/blob/c2229e7557450cd2842269f5fe9cb8586e90b50c/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java#L867-L875

Version 8 (CSP friendly) is only used, if isJavaScript is falsy. There is still some code, which sets isJavaScript to true if escaped strings are bigger thant 64 KBytes.

Steps to reproduce

Serialize a string bigger than 64 KBytes with GWT-RPC.

codeart1st commented 1 week ago

Relates to #9578 and https://github.com/gwtproject/gwt/pull/9961

Didn't see in the first place.

https://github.com/gwtproject/gwt/blob/c2229e7557450cd2842269f5fe9cb8586e90b50c/user/src/com/google/gwt/user/server/rpc/impl/ServerSerializationStreamWriter.java#L348-L349