You are not logged in.
Pages: 1
Ok, thanks for reply
Hi,
do you can update Synode units
to compile with latest version of mORMot?
Thank you
Hi,
do you can try r := JSONEncode(['t','test "" again ""']);
Result: {"t":"text \"" again ""\" again \""\""}
Fast Patch (inserted line // mapes):
procedure TTextWriter.AddJSONEscapeW(P: PWord; Len: PtrInt);
var i,c,s: PtrInt;
esc: byte;
begin
if P=nil then
exit;
if Len=0 then
Len := MaxInt;
i := 0;
while i<Len do begin
s := i;
repeat
c := PWordArray(P)[i];
if (c<=127) and (JSON_ESCAPE[c]<>0) then
break;
inc(i);
until i>=Len;
if i <> s then // mapes
AddNoJSONEscapeW(@PWordArray(P)[s],i-s);
if i>=Len then
exit;
c := PWordArray(P)[i];
if c=0 then
exit;
esc := JSON_ESCAPE[c];
if esc=1 then // #0
exit else
if esc=2 then begin // characters below ' ', #7 e.g. -> \u0007
AddShort('\u00');
AddByteToHex(c);
end else
Add('\',AnsiChar(esc)); // escaped as \ + b,t,n,f,r,\,"
inc(i);
end;
end;
Thanks ab, works.
Of course I have first tried this solution.
in MultiPartFormDataDecode
you have this line:
part.Content := copy(Body,i,j-i-2); // -2 to ignore latest #13#10
So in this case changing one line feed from #10 to #13#10 seems like right answer :-)
Hi,
crc := 'A8FBDC27';
MultiPartFormDataAddField('crc',crc,fMultipart);
after decode on server side
crc = 'A8FBDC2'
I think problem is in MultiPartFormDataEncode:
W.Add('--%'#13#10'Content-Disposition: form-data; name="%"'#13#10+
'Content-Type: %'#13#10#13#10'%'#10'--%'#13#10,
[bound,Name,ContentType,Content,bound]) else begin
should be
W.Add('--%'#13#10'Content-Disposition: form-data; name="%"'#13#10+
'Content-Type: %'#13#10#13#10'%'#13#10'--%'#13#10,
[bound,Name,ContentType,Content,bound]) else begin
Ok.
But if local time used for TJWTAbstract.Compute > server time,
j.Verify = jwtInvalidIssuedAt.
Is there a way to compute from Server TimeStamp ?
Hi,
j := TJWTS3512.Create(JWTLoginSecret, JWTIterationCount, [jrcIssuer, jrcSubject, jrcExpirationTime,jrcIssuedAt,jrcAudience, jrcJWTID], [], 60);
j.Verify(data, jc,[jrcIssuedAt,jrcAudience]);
if data contain IssuedAt claim, gets verified even if is in Excluded claims.
Is it expected behaviour?
Hi,
in SynNodeBinding_HTTPClient
is used TWinHTTP for Windows and TCurlHTTP for Linux
Is it problem to add in
TCurlHTTP.InternalSendRequest
curl.easy_setopt(fHandle,coFollowLocation,1)
to achieve the same behavior?
Because under Windows the result is 200 (auto redirection), under Linux 302 and Location: .... in headers
in case the requested site uses internal redirection
Hi,
If I add empty string to array,
sorting the array causes AV.
rev 1.18.4885
procedure foo;
var Ar: TStringDynArray;
s: String;
AK: TDynArray;
begin
AK.Init(TypeInfo(TStringDynArray),Ar);
s := 'a';
AK.Add(s);
s := '';
AK.Add(s);
AK.Sort(SortDynArrayString);
end;
Hi,
I'm using TSQLRestServerDb with Postgresql
fServer := TSQLRestServerDB.Create(fModel);
fServer.CreateMissingTables(0,INITIALIZETABLE_NOINDEX);
Is there a way to know, what tables were actually created on remote DB with CreateMissingTables ?
Even If I use INITIALIZETABLE_NOINDEX, table on remote DB is always created with Primary ID index. Is this expected behavior?
Hi,
under linux fs.readdirSync is not reading Directories.
in fs_readDir
{$IFDEF MSWINDOWS}
if FindFirst(Dir + '*.*', searchAttr, F) = 0 then begin
{$ELSE}
if FindFirst(Dir + '*', searchAttr, F) = 0 then begin
{$ENDIF}
or FindFirst (Dir + '*',searchAttr,F) for both OS solves the problem.
I can have only Delphi 7, so FPC for windows is the only way for me I suppose.
I really don't know why, when using Properties instead of Parameter there is allways nil.
And FPC for linux is what I'm looking forward.
Hi,
I have tried to compile Example 2 in Delphi XE3, but got AV.
The problem is related to
https://synopse.info/forum/viewtopic.php?id=1733
To make it work, following functions must be used instead of Properties:
SpiderMonkey 45:
JSRuntime
function GetPrivate: Pointer;
procedure SetPrivate(const Value: Pointer);
function GetOptions: PJSRuntimeOptions;
function GetGCParameter(key: JSGCParamKey): uint32;
procedure SetGCParameter(key: JSGCParamKey; const Value: uint32);
function GetErrorReporter: JSErrorReporter;
procedure SetErrorReporter(er: JSErrorReporter);
function GetInterruptCallback: JSInterruptCallback;
procedure SetInterruptCallback(callback: JSInterruptCallback);
JSRuntimeOptions
function getOptions(const Index: Integer): Boolean;
procedure setOptions(const Index: Integer; const Value: Boolean);
SpiderMonkey 52:
JSContext
function GetPrivate: Pointer; {$ifdef HASINLINE}inline;{$endif}
procedure SetPrivate(const Value: Pointer);
JSContextOptions
function getOptions(const Index: Integer): Boolean;
procedure setOptions(const Index: Integer; const Value: Boolean);
For some reason SM52 fRt.GCParameter[] works, in SM45 need fRt.SetGCParameter
Yeah, it works. Thanks for advice
Hi,
I have tried example from page 1, just added 5 lines of code
TMyMap = record
Key: string;
Value: array of string;
end;
TMyMapDynArray = array of TMyMap;
var
Map: TMyMap;
Maps: TMyMapDynArray;
MapW: TDynArrayHashed;
key: string;
i: integer;
begin
MapW.Init(TypeInfo(TMyMapDynArray),Maps);
Map.Key := 'Some key';
SetLength(Map.Value,2);
Map.Value[0] := 'One';
Map.Value[1] := 'Two';
// from here added code
MapW.Add(map);
Map.Key := 'Some key 2';
Map.Value[0] := 'Five';
Map.Value[1] := 'Three';
MapW.Add(map);
I end up with result like this: (('Some key', ('Five', 'Three')), ('Some key 2', ('Five', 'Three'))).
For simple variables TDynArray works well, but for arrays in record has array always value of last added record.
Or am I doing something wrong?
Pages: 1