You are not logged in.
Pages: 1
Hello,
today I have upgraded mormot from version from 29th April to the newest. After change I found unexpected change in creation of stubs for interfaces with RawByteString properties. Earlier stub was prepared using following code:
cPassword: RawUTF8 = 'hasloPlain';
cPasswordEncoded: RawByteString = 'hasloEncoded';
TInterfaceStub.Create(TypeInfo(IGxPasswordCoder), coder).
Returns('Encode', [cPassword], [cPasswordEncoded]);
and stub works correctly. After upgrading, stub after calling Encode function returns wrong value. Only when preparation code is changed to:
TInterfaceStub.Create(TypeInfo(IGxPasswordCoder), coder).
Returns('Encode', [cPassword], [BinToBase64(cPasswordEncoded)]);
then everything works correctly. I just want to know: Is it intentional change in mORMot and must I change all my stubs definitions?
Last edited by ASiwon (2015-07-18 15:20:05)
best regards
Adam Siwon
Offline
I suspect this comes from the fact that RawByteString are now encoded as Base64, when serialized as JSON.
Previous behavior was not correct, since any #0 char within the RawByteString may have broken the process.
It also allows to send arbitrary binary data from interface-based services to (web) clients, in a standard way.
I think the new pattern is more correct.
Your cPasswordEncoded should be serialized as Base64 string, in the JSON content.
Offline
Pages: 1