Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GWT 2.12 CSP RPC escapeString 64KB limit #10043

Closed
codeart1st opened this issue Nov 11, 2024 · 1 comment
Closed

GWT 2.12 CSP RPC escapeString 64KB limit #10043

codeart1st opened this issue Nov 11, 2024 · 1 comment

Comments

@codeart1st
Copy link

GWT version: 2.12.0


Description

// If there's another segment left, insert a '+' operator.
if (splitNodes && i < length) {
charVector.add(JS_QUOTE_CHAR);
charVector.add('+');
charVector.add(JS_QUOTE_CHAR);
if (array != null) {
array.setJavaScript(true);
}
}

private void writeHeader(LengthConstrainedArray stream) {
stream.addToken(getFlags());
if (stream.isJavaScript() && getVersion() >= SERIALIZATION_STREAM_JSON_VERSION) {
// Ensure we are not using the JSON supported version if stream is Javascript instead of JSON
stream.addToken(SERIALIZATION_STREAM_JSON_VERSION - 1);
} else {
stream.addToken(getVersion());
}
}

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
Copy link
Author

codeart1st commented Nov 11, 2024

Relates to #9578 and #9961

Didn't see in the first place.

private static final int MAX_STRING_NODE_LENGTH =
Integer.getInteger("gwt.rpc.maxStringNodeLength", 0xFFFF);

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

No branches or pull requests

1 participant