Skip to content

RPC format relies on eval for large payloads and long strings #9578

@niloc132

Description

@niloc132

GWT version:2.8.2
Browser (with version):any
Operating System:any


Description

From #8197 (comment), it turns out that RPC's server serialization stream writer still assumes that the browser needs concatenated strings and arrays.

However, the strings were concatenated to support hosted mode (which apparently at the time couldn't support larger than 64kb strings), but that appears to have been fixed, and arrays were split to support a bug in IE6/7 where long arrays couldn't be eval'd, but again, we don't support IE6/7 any more.

So, we don't really need it. Additionally, this is an issue since it violates CSP, as eval isn't particularly safe, and some sites would like to forbid its use to further protect their data and their users.

I'll try removing these hacks and confirm that eval is no longer called (except of course in browsers that do not support JSON.parse), and confirm that running dev mode can handle giant strings correctly as well. This should remove the ability of the server to produce streams older than version 8 (since ServerSerializationStreamWriter.writeHeader is the only code that should be writing out a version for the client). Will leave in support on the client for reading older streams, as we've done in the past.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions