Jump to content

omnibrain

Members
  • Content Count

    95
  • Joined

  • Last visited

Community Reputation

14 Good

Technical Information

  • Delphi-Version
    Delphi 11 Alexandria

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I got a (somewhat working example with minimal changes to the demo. I used the postinfo-Demo, because I think you added that specifically to test POST. \demos-data\WebAppServerData\Templates\postinfo.htm is missing, but that doesn't matter for the test. My one change: procedure TWeblServerForm.SslHttpAppSrv1AuthGetType(Sender, Client: TObject); var ClientCnx : TMyHttpConnection; begin //{ It's easyer to do the cast one time. Could use with clause... } ClientCnx := TMyHttpConnection(Client); if CompareText(ClientCnx.Path, '/DemoBasicAuth.html') = 0 then begin ClientCnx.AuthTypes := [atBasic]; ClientCnx.AuthRealm := 'DemoBasicAuth'; end else if CompareText(ClientCnx.Path, '/postinfo.html') = 0 then begin // Added for Debugging Basic Auth ClientCnx.AuthTypes := [atBasic]; ClientCnx.AuthRealm := 'DemoBasicAuth'; end GET with no credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" 192.168.178.105 - WEB-APP /postinfo.htm Answer Log - 2024-03-27 23:35:45 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 - 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 401 337 218 0 GET with wrong credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:37:08 192.168.178.105] authentication result failed with type Basic for /postinfo.html 192.168.178.105 - WEB-APP /postinfo.html Answer Log - 2024-03-27 23:37:08 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 test1 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 401 337 257 0 GET with correct credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:38:01 192.168.178.105] authentication result OK with type Basic for /postinfo.html 192.168.178.105 - WEB-APP /postinfo.html POST/PUT Content Size 0 Request Content Type Answer Log - 2024-03-27 23:38:01 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 test 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 261 0 POST with no credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:39:25 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 - 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 272 0 POST with wrong credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:40:33 192.168.178.105] authentication result failed with type Basic for /postinfo.html POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:40:33 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 test1 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 311 0 POST with correct credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:41:23 192.168.178.105] authentication result OK with type Basic for /postinfo.html [23:41:23 192.168.178.105] 1: HTTP/1.1 POST /postinfo.html POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:41:23 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 test 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 315 0 As you can see, with GET only with correct credentials .execute gets called. With POST .execute always gets called.
  2. GET is working. POST is where I have trouble. I'm going to try to reproduce it with the sample.
  3. I don't think this works properly in 9.1. On GET with failed Authentication I get a 401 from ICS with the following document (btw, where can I edit/override this?): <HTML><HEAD><TITLE>401 Access Denied</TITLE></HEAD><BODY><H1>401 Access Denied</H1>The requested URL /ping requires authorization.<P></BODY></HTML> On POST I still land in my .Execute-Function. But Client.AuthUserName doesn't get cleared. I would expect, that like with GET I don"t even come into the .Execute-Function. The second best solution would be, if the FAuthenticated was available at the Client. So I could check this. (It took me two years to get back to this, because I was building other endpoints where I do custom jwt processing and had no need for basic auth, in case you wonder)
  4. omnibrain

    Delphi-neon, any thought?

    I use it as main serializer/deserializer for various json based protocols. No complaints so far and it makes programming easier. I did not benchmark it for speed, because we are only talking about a few messages per second. For serializing/deserialiszing table data I use viniciussanchez/dataset-serialize: JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC) (github.com)
  5. omnibrain

    ICS V9.1 announced

    I never changed anything in there so I had no problem "overwriting" it. I prefer to understand the settings, and change them if needed, so this was alright to me. Starting with 9.0 I started using ICS "directly" instead of via GetIt and I also decided to vendor the used release into my git repo, so I can easily track the changes between the releases, or if I have to patch something.
  6. omnibrain

    ICS V9.1 announced

    Update went (at least I think so) without a hitch. Because the way we deploy our software is a bit special I had to change the SSL-Settings, but I think it is ok, that you chose the new way as default.
  7. I downloaded and installed the latest daily snapshot from https://wiki.overbyte.eu/arch/icsv9w.zip but still can't get PUT to work. I still run into the "Flags"-check from my original post. Am I missing something else? The Flags in question contains hg404. The path I call the PUT with Postman is http://192.168.247.109:16008/v2/object/1004/person My other GET and POST Handlers work like they used to. Edit: If I comment out the Flags-Check like I did in my original post it now works. So your fix handling the uploads worked.
  8. When further testing I discovered an additional problem: My PUT obviously happens with data. But in my dispatched handler no data arrives. When debugging I noticed, that the handler get's dispatched before the data is received. An additional ConnectionDataAvailable where FState is hcPostedData happens after the dispatch. I meant to test it properly all earlier, after you implemented it for me, but other projects happened and my workaround with POST worked.
  9. I added a PUT handler to my API (so far I worked with POST, for my new API iteration I'm finally getting to implementing PUT), but it does not get dispatched. HttpAppSrv1.AddPutHandler('/'+porticoversion+'/object/*',Tlisaapiportico); // Person anlegen PUT /object/{oid}/person Tlisaapiportico is implementing TUrlHandler. I debugged, and it looks like the handler get's correctly added to the FPutHandler, but PutDispatchVirtualDocument gets never reached. Further debugging (and comparison with POST) lead me to TriggerPutDocument. When I comment out the "Flags-Check" it works. procedure THttpAppSrv.TriggerPutDocument( { V8.67 } Sender : TObject; var Flags : THttpGetFlag); begin //OutputDebugString(PChar('HTTP_PUT ' + (Sender as THttpAppSrvConnection).Path)); inherited TriggerPutDocument(Sender, Flags); { if Flags in [hgWillSendMySelf, hg404, hg403, hg401] then Exit ; } // Handle all virtual documents. Returns TRUE if document handled. if PutDispatchVirtualDocument(Sender as THttpAppSrvConnection, Flags) then Exit; // Reject anything else Flags := hg404; end; In TriggerDeleteDocument is a similar check. I did not test it yet, but I imagine I'm going to run into the same problem. Of course I don't know if the real problem is, that the flag get's set wrong somewhere higher in the call stack, or if the inherited call should do something instead.
  10. omnibrain

    TIdSNTP still providing daylight saving time

    Ah, I see. Thank you. I did not know, that Indy is on github. Let's hope the fixed version comes with Delphi 12.
  11. I'm currently testing IcsTimeClient but I'm running into inexplicable timeouts when trying to get the time of ptbtime1.ptb.de. It looks like it's resolving the IP correctly (192.53.103.108) and when I try to get the time from the same server via the Indy-Component it works. Other servers, like the NIST-servers NIST Internet Time Service work with IcsTimeClient too. I tried both, with the OverbyteIcsTimeTst program and my own, reduced to the basics, one.
  12. omnibrain

    RCS Chats - Rich Communication Services

    I don't think Apple is using RCS. And the track record of Google regarding messaging is not the best. ~10 years ago there were some failed attempts of carriers in Germany trying to push a RCS based messenger. But WhatsApp had already won back then.
  13. omnibrain

    TIdSNTP still providing daylight saving time

    Of course, but in the code of the component there is "NTPToDateTime" and in there "UTCTimeToLocalTime". And like I said. Last week it worked. I would have expected an error of 2 hours last week, if this was the case.
  14. I am using Delphi 11.2 (Patch 1) on Windows 11 (22H2): A few weeks ago, I added a check to our software to be able to verify against a time server independently of the rest of the system, as our customers had issues with internal network time synchronization in the past. Since Sunday, we "suddenly" have a one-hour deviation. Last weekend we went back from UTC+2 to UTC+1. I have simplified it to the most basic test possible, just a form with a TIdSNTP component and an edit box to enter the server. And even then, I still get a time that is exactly one hour in the future. Have I overlooked something? Since we are now on "standard time," I would have expected there to have been problems during development and testing in the past weeks. IdSNTP1.Host:=LabeledEdit1.Text; memo1.Lines.Add('Server: '+LabeledEdit1.Text+' Internet time: '+DateTimeToStr(IdSNTP1.DateTime)+' Local time: '+datetimetostr(now)); The result is:
  15. omnibrain

    ANN : TECNativeMap 5.1

    I've sent you an email asking for a quote.
×