MARS-Curiosity 1.7.1: Delphi 13.2, large payloads and fixes
One week after MARS 1.7, here is 1.7.1: a small maintenance release that adds support for the newest Delphi and fixes three issues reported right after 1.7 shipped. Thanks to everyone who upgraded quickly and sent feedback.
Delphi 13.2 support
Embarcadero has just released Delphi 13.2 Florence and MARS supports it out of the box: packages are upgraded to the new project format, and a compilation error caused by the stricter handling of generic types in the 13.2 compiler is fixed in MARS.Rtti.Utils. MARS keeps supporting every version from Delphi 10.2 Tokyo up to 13.2.
Large arrays of records, on both sides
Two related issues, both about TArray<record> payloads with many thousands of elements:
- On the client side (#205),
TMARSClientResourceJSON.POST<R>andPUT<R>used to build the complete JSON tree, then the complete JSON string, then copy it to the request stream: three copies of a large payload, enough to exhaust memory on Win32. They now stream the array one record at a time through the newTJSONArray.ArrayOfRecordToStream<T>, which you can also use directly wherever you serialize large arrays to a stream. - On the server side (#206), the message body reader for arrays of records no longer parses the whole incoming array into a JSON tree. A small byte scanner locates the top-level elements and each record is parsed and converted on its own; malformed or unexpected input still goes through the full parser, so behavior on errors is unchanged.
No code changes are needed to benefit from either.
No JWT configuration for applications that don’t use JWT
1.7 tightened the handling of JWT.Secret (no more silently running with the public default). That check was a bit too eager: applications with no protected resource at all were asked for a secret anyway (#207). The secret is now required only where JWT is actually used, that is when a request hits a protected resource or when a token is issued. An application whose resources are all public needs no JWT setup, and a token sent to it is simply never trusted.
Get it
Sources and installer are on the GitHub releases page; the documentation site is updated. As usual, issues and pull requests are welcome.