omnibrain
Members-
Content Count
107 -
Joined
-
Last visited
Everything posted by omnibrain
-
Adding (CORS) Headers for simple fileserving THttpServer
omnibrain replied to omnibrain's topic in ICS - Internet Component Suite
How should I have known? I figured it out in the end, so it wasn't too difficult after all... I understand. That totally makes sense. -
Adding (CORS) Headers for simple fileserving THttpServer
omnibrain replied to omnibrain's topic in ICS - Internet Component Suite
You might have misunderstood me. I did not use "SendHeader" by myself. I just initialised PersistentHeader:='Access-Control-Allow-Origin: *' before starting the server. Then I wondered why my browser hung accessing the served files and why Postman chocked on the headers. So I debugged into the "SendHeader" function and saw there, that it loses the second CRLF at the end of the header when adding the PersistentHeader. I guess that leads to a missing blank line between header and body, but I did not go that low level while debugging. My workaround is to add a CRLF to the end of the PersistentHeader when I set it in my Program. But I think (at least from an UX standpoint) that should not be necessary. -
Adding (CORS) Headers for simple fileserving THttpServer
omnibrain replied to omnibrain's topic in ICS - Internet Component Suite
I found something I overlooked earlier: The PersistentHeader property might be useful. But there might be a bug in THttpConnection.SendHeader. I looks like, that in adding the PersistentHeader the second #$d#$a at the end of the headers might gets omitted. That means, that the blank line between headers and body is missing. -
Adding (CORS) Headers for simple fileserving THttpServer
omnibrain replied to omnibrain's topic in ICS - Internet Component Suite
I don't use any of them. I use the "automatic serving of the contents of the DocDir" method. So I think I would have to use the events, I guess. But where can I add a custom header to the automatic response? Do I need to create my derived "myHttpConnection" class and override "ProcessGet"? -
Tsilang is horrible, horrible, horrible for source control. It stores the translation data in a blob within the DFM. I don't know the other tools, but I would take a sharp look at how they store their translation data.
-
And if I install 11.2 now, I have still to install the patch and do the fix, because there is no updated install file?
-
POP, IMAP and SMPT with OAuth2 (Microsoft Office 365 services)
omnibrain replied to Milo G's topic in Network, Cloud and Web
My Understanding is, that App passwords also will stop working: Office 365 App passwords | Blog | Limilabs I tried to jump through a lot of hoops and use OAuth with Clever Internet Components, but it all lead to errors, but I might try again, because: I tried the TMS FNC Cloud Outlook Mail component, but you can only read and send mail. I also need to delete or at least move mail. Has someone found another component? I don't have the time to implement and maintain the Graph API by myself. -
Are the jcl and jvcl libraries still alive?
omnibrain replied to Davide Angeli's topic in Delphi Third-Party
But when you are only a handful of trusted contributors you don't have to use the Github workflow but can have them merging (perhaps with rebase and smashing) locally and then have them push the changed branches to Github. And if you work this way with your trusted contributors you can still be open for external contributors with the Github Fork-Merge-Request-Workflow. That's really the best of both worlds. We have to face, that Delphi itself is obscure enough for younger developers. Clinging to outdated tools, hosting options and workflows nobody learns anymore isn't going to help. -
I'm looking for a small component/library to just draw some vectors, perhaps add some predefinded shapes and load some bitmaps, save everything and perhaps export to bmp/png, whatever. I want to be able to "paint" by hand and "paint programatically". I found littleearth/draw-objects: draw-objects (github.com) (Update to TDrawObject Components (angusj.com)) In a previous search I found something similar, but I can't seem to find it anymore. Perhaps someone has an idea? I don't think I need a fullblown CAD solution...
-
Looking for small (vector) drawing component/library
omnibrain replied to omnibrain's topic in Delphi Third-Party
If you would be so kind to point me into the direction where I can find GR32_Objects I could evaluate it. But it is not part of the Graphics32 repository. From my google search it looks like it was an add on by AngusJ, who concentrates on Image32 now. But I fail to find a source. But a couple of hundred lines are indeed too large an effort if it means reinventing the wheel. That's why I asked first for a finished solution. I can still invent the wheel if it's not invented yet, or I need square wheels for whatever reason. The TMS component linked by SwiftExpat is an option, but it looks like that the Delphi Area Simple Graph Component (despite being abandoned by its creator) is sufficient for my needs. -
Looking for small (vector) drawing component/library
omnibrain replied to omnibrain's topic in Delphi Third-Party
Thanks. Of course I found Graphics32 and Image32, but they seem to be a bit much. And it looks like I need to implement the basic stuff I need (the drawing) by myself. At least I did not find the "old demo of the GR32_Objects unit" you mentioned. -
Looking for small (vector) drawing component/library
omnibrain replied to omnibrain's topic in Delphi Third-Party
Thanks, I know Skia and toyed with the demo programs for a bit. Skia sure is capable, but using Skia would mean that I have to implement all the "diagram" stuff like click to place, connecting lines, etc. -
Looking for small (vector) drawing component/library
omnibrain replied to omnibrain's topic in Delphi Third-Party
Thanks, I did not know that. That looks like it's a bit much... I also don't understand what "FNC" means. Are they "native" VCL or something different? It may or may not come with a whole host of baggage... In the meantime I found the other component again: DELPHI AREA » Simple Graph Component I really need only some basic stuff I can salvage into my own application. Edit: I tried both and neither has the option to insert (background) bitmaps in the demo. I guess that would be easy enough to implement, but if I remember correctly I had another one that offered this option out of the box. But I can't find it anymore... Edit2: Might have been Simple Graph after all. There in the Demo I can set a bitmap as background in one shape and use that as a background for everything else. -
We too are using TMS MQTT to connect to a broker to send and receive. It works quite well, but we initially had some trouble with the correct signaling of lost connections. Hi Sergio, does your component support mTLS (mutual TLS)? I'm working on a scenario where we want to use Scaleways IoT Hub, which offer that the clients can authenticate with the broker via mTLS.
-
json Trouble getting JSON FindValue (JSONPath) to work
omnibrain posted a topic in Network, Cloud and Web
I'm trying to use JSONPath via TJSONObject.FindValue in my program. I'm using Delphi 11. I broke it down to the easiest example and I still can't get it to work: { "name": "Chris", "value": 10000 } Path: $.name My Code after stripping away everything else: var myjson:=TJSONObject.ParseJSONValue('{"name": "Chris","value": 10000}'); var myval:=myjson.FindValue('$.name'); ergebnis.Text:=myval.Value; The JSON get's parsed, but the FindValue returns 'nul'. Am I doing something completely wrong? -
json Trouble getting JSON FindValue (JSONPath) to work
omnibrain replied to omnibrain's topic in Network, Cloud and Web
Thanks, it works now. 🙂 Perhaps it's me being daft, but I cloud not read either from System.JSON.TJSONObject.FindValue - RAD Studio API Documentation (embarcadero.com) or System.JSON.TJSONPathParser - RAD Studio API Documentation (embarcadero.com) that I don't need to address the document root. Or is there some documentation/example I missed? -
I'm currently experimenting with Turbopack DosCommand and try to capture the following output for the "ping" command. (ping is just an example I try with) Ping wird ausgeführt für 8.8.8.8 mit 32 Bytes Daten: But the DosCommand doesn't seem to decode the output right: Ping wird ausgef�hrt f�r 8.8.8.8 mit 32 Bytes Daten: I tried to implement the CharDecoding event to decode the output for Unicode function TForm4.DosCommand1CharDecoding(ASender: TObject; ABuf: TStream): string; var pBytes: TBytes; iLength: integer; begin ilength := ABuf.Size; if iLength > 0 then begin SetLength(pBytes, iLength); ABuf.Read(pBytes, iLength); Result := TEncoding.Unicode.GetString(pBytes); end else Result := ''; end; but I only get chineese characters as a result: 楐杮眠物畡杳晥梁瑲映犁㠠㠮㠮㠮業⁴㈳䈠瑹獥䐠瑡湥ഺ湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㐲獭吠䱔ㄽ㔱湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㐲獭呔㵌ㄱവ湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㈲獭吠䱔ㄽ㔱湁睴牯⁴潶⸸⸸⸸㨸祂整㵳㈳娠楥㵴㈲獭吠䱔ㄽ㔱楐杮匭慴楴瑳歩映犁㠠㠮㠮㠮ഺ †倠歡瑥㩥䜠獥湥敤⁴‽ⰴ䔠灭慦杮湥㴠㐠敖汲牯湥㴠〠††〨‥敖汲獵⥴ബ慃敚瑩湡慧敢湩䴠汩楬敳ഺ †䴠湩浩浵㴠㈠洲ⱳ䴠硡浩浵㴠㈠洴ⱳ䴠瑩整睬牥⁴‽㌲獭
-
Thanks, that worked. The joys of windows legacy and eternal backwards compatibility...
-
(13, 10, 80, 105, 110, 103, 32, 119, 105, 114, 100, 32, 97, 117, 115, 103, 101, 102, 129, 104, 114, 116, 32, 102, 129, 114, 32, 56, 46, 56, 46, 56, 46, 56, 32) This is the value from "pbytes" from the watchlist. #$D#$A'Ping wird ausgef'#$0081'hrt f'#$0081'r 8.8.8.8 ' is the result after "TEncoding.ANSI.GetString"
-
Same as without event handler, which is no surprise, as "TEncoding.ANSI" is the default in the DosCommand Unit. https://github.com/TurboPack/DOSCommand/blob/4ded41648e4e1aafa372c7a740fb2366aeb3e9e4/Source/DosCommand.pas#L1042
-
GetIt on my Delphi 11 still shows 8.68. Does the release via GetIt take more time, or did I miss some refresh somewhere?
-
THttpAppSrv - Add*Handler for PUT and DELETE
omnibrain posted a topic in ICS - Internet Component Suite
I'm currently designing a REST API for a larger existing Delphi application and I'm currently looking into various options. I don't need a lot of "magic", I actually prefer my code to be straight forward so THttpAppSrv looks great to me. I should be able to implement most of my endpoints in GET and POST-Handlers. But for some PUT and DELETE would make more sense. How would I best implement PUT and DELETE? Should I work around and just use GET and POST for everything? Can I somehow use a "generic" dispatch with THttpAppSrv, handle PUT and DELETE there and use the GET- and POST-mechanism as provided? Or would it be easy to add PUT- and DELETE-Handler "infrastructure" to THttpAppSrv? I tried looking into the code, but I'm not familiar with ICS so it's all greek to me... -
THttpAppSrv - Add*Handler for PUT and DELETE
omnibrain replied to omnibrain's topic in ICS - Internet Component Suite
After I updated ICS (to 8.68) I added the handlers for PUT and DELETE, but it looks like I never tested them properly. My process produces only "501 Unimplemented". I wanted to try your example OverbyteIcsDDWebService.dproj because there you added the handlers, but I couldn't compile it. I had to add 'OverbyteICSURl' to the Uses of 'OverbyteIcsDDWebServiceSrv' and Answer String in line 2398 misses the code page argument. After fixing that I could compile and start (after editing the .ini) the process. But there it also throws an "501 Unimplemented" for the put handler when calling delete for "restapi.html. In the end I needed to add the options 'hoAllowPut' and 'hoAllowDelete'. After I added them on my project the calls work as well. So I can say it works now, but your example may need some minor tweaks. -
THttpAppSrv processing post despite failed basic auth
omnibrain replied to omnibrain's topic in ICS - Internet Component Suite
Did you have time to check if there is a bug for POST and why GET produces alternately a 401 and 500 on failed authentication? -
THttpAppSrv processing post despite failed basic auth
omnibrain replied to omnibrain's topic in ICS - Internet Component Suite
Checking Client.AuthUserName in .Execute would work for me (if it worked). It would also pave the way for future endpoints with different authorizations per user. I tried it and Client.AuthUserName is always filled, so there might really be a bug as you suspect. But I still wonder why I even get into .Execute after authenticated failed for the "post", while the "get" produces a "401" (and every other time a 500...) before calling the .Execute.