Jump to content

xauxag

Members
  • Content Count

    5
  • Joined

  • Last visited

Posts posted by xauxag


  1. On 1/6/2024 at 1:02 AM, Kas Ob. said:

    Please try this instead

    
    procedure TForm1.Button3Click(Sender: TObject);
    var
      s: AnsiString;
      ServerKey: string;
    begin
      s := AnsiString(edit1.Text);
      ServerKey := Base64Encode(SHA1ofStr(s));
      Memo1.Lines.Add(ServerKey);
    end;

     

    Thanks, It works

    19 hours ago, Kas Ob. said:

    If @xauxag can provide some more input about the locale and settings then it is possible to test it.


    I had being using https://github.com/xupefei/Locale-Emulator for years for the purpose of testing when such problem appear or for testing a specific non internationalized (English) application.

     

    It is Chinese simplify


  2. 3 hours ago, Angus Robertson said:

    Are you suggesting there is a problem with the Base64Encode function creating incorrect output? 

     

    Have you attempted to debug and fix the problem yourself, or are you expecting someone else to do it?

     

    I've been testing the OverbyteIcsWebSocketCli unit this week and it works fine. 

     

    Angus

    Yes I am pretty sure it's a bug, I have debug into  ICS  and found the two function that caused failure of websocket connection ,  and am expecting fixing from more official way .  I just a little time ago found it and  am looking into those code , and not sure exact the correcting  till now  , so any suggestions are  welcome  


  3. Hi, Here may be a bug,would you  please have a look?, 

     

    unit:  OverbyteIcsWebSocketCli.pas

    position: line 1494   ServerKey := Base64Encode(String(SHA1ofStr(s)));

     

    ------------

    test:   x3JJHMbDL1EzLkh9GBhXDw==258EAFA5-E914-47DA-95CA-C5AB0DC85B11

    expect: HSmrc0sMlYUkAGmm5OPpG2HaGWk=

    output:HSmrc0sMlYUkAGmm5OPpG2E/aQ==

     

    ------------
    test  code:

    procedure TForm1.Button3Click(Sender: TObject);
    var
       s : AnsiString;
       ServerKey:string;
    begin
            s := AnsiString(edit1.Text);
                ServerKey := Base64Encode(String(SHA1ofStr(s)));
                memolog.Lines.Add(ServerKey);
    end;
    1.thumb.jpg.f2ad00f8ab32b748f5940505d2092fbf.jpg

    node.js - Base64 encoding for Sec-WebSocket-Accept value - Stack Overflow


  4. version icsv858

    unit OverbyteIcsHttpProt

    procedure THttpCli.GetHeaderLineNext;

    Line 3056:   if Field = 'location' then begin { Change the URL ! }

     

    I think is a bug,

    Based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201

    The HTTP 201 Created success status response code indicates that the request has succeeded and has led to the creation of a resource.

    So with Fstatuscode = 201 , there can be a location line in the http header as a normal response

     

    Here is a example,

    when I send a post to the server,the server response with a location line, but it was taken as a redirection ,so ICS resend the post to the new llocation again :

     

    Connected to: api-fxtrade.oanda.com
    > POST /v3/accounts/001-004-********-002/orders HTTP/1.1

    ...
    api-fxtrade.oanda.com SSL Connected OK with TLSv1.2, cipher DHE-RSA-AES256-GCM-SHA384, key auth RSA, key exchange DH, encryption AESGCM(256), message auth AEAD
    ...

    < HTTP/1.1 201 Created

    < Location: https://api-fxtrade.oanda.com/v3/accounts/001-004-******-002/orders/240
    < RequestID: 42647542696837564
    = https://api-fxtrade.oanda.com/v3/accounts/001-004-******-002/orders Redirected to: https://api-fxtrade.oanda.com/v3/accounts/001-004-******-002/orders/240
    Connected to: api-fxtrade.oanda.com
    > POST /v3/accounts/001-004-******-002/orders/240 HTTP/1.1

     

    ResponseRaw:{"errorMessage":"POST not allowed for endpoint."}

     

    I change the code to

     

    if (Field = 'location') and (FStatusCode <> 201)  then begin { Change the URL ! }

     

    The reponse is OK

     

    So please check.

     

×