Closed chrswgnr closed 2 years ago
This is weird, because the length comes directly from the Windows API, i.e. Req^.CookedUrl.FullUrlLength. Please try https://synopse.info/fossil/info/cb30095a75
I tested your patch, with those changes it's fixed.
Well maybe a bug in the windows api then. I am on a Windows 10 Enterprise 1909 right now.
After more checking, the length was in bytes, not WideChars (as would be logical), so my code was incorrect. Using ending #0 as in my fix is always good, and not really slower, so we will keep it. ;) Thanks for the report.
Alright! Thanks for the quick reply and fix! :)
Hey, i used the THttpApiServer from current master branch, and attached a OnRequest handler. I had to notice that a bufferoverread happens for the FullUrl from THttpServerRequest. This is only the case for THttpServerRequest.FullUrl, THttpServerRequest.Url is correct.
Since the nullterminator is correct there, i current work around that by using Split([#0])[0]