#1 2023-04-25 13:30:57

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Base64Magic Missing for SynCrossPlatform Client

Im not pretty sure "when" it changed. but we noticed today, that RawByteStrings (member of a record) are send without JSON_BASE64_MAGIC Chars at the beginning.

SynCrossplatformJSON's Base64JSONStringToBytes testet for this by default and as it is not present my Blob is not received.
I changed the Withbase64Magic to false and my Blob is received correct.

my m2 Record looks like this:


  RRecord = packed record
    dateiname : RawUtf8;
    groesseinbytes : integer;
    dateityp : RawUtf8;         
    dateidatum : TDateTime;
    dokument : RawByteString;   // <- This Data is send without magic
  end;

On Client it looks like this:

  RRecord = record
    dateiname: String;
    groesseinbytes: Integer;
    dateityp: String;
    dateidatum: TDateTime;
    dokument: TSQLRawBlob;
  end;


function Variant2RRecord (_variant: variant): RRecord;
var _a: integer;
    _arr: PJSONVariantData;
begin
  result.dateiname := _variant.dateiname;
  result.groesseinbytes := _variant.groesseinbytes;
  result.dateityp := _variant.dateityp;
  result.dateidatum := Iso8601ToDateTime(_variant.dateidatum);
  result.dokument := VariantToBlob(_variant.dokument);
end;

Is this the new "default" behavior or is it an Error ?


Rad Studio 12.1 Santorini

Offline

#2 2023-04-25 14:15:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Base64Magic Missing for SynCrossPlatform Client

This is the new default behavior for mORMot 2.

Offline

#3 2023-04-25 18:25:15

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 516

Re: Base64Magic Missing for SynCrossPlatform Client

Tyvm


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB