Thanks a lot for your answer. Really, my way was not correct. Now I tried to set
Srvr.Response.Done := True;
before WriteHeader and it works fine as I can see.
By the way, did you found any memory leaks in v514? My tests with FastMM4 says:
This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):
13 - 20 bytes: TRtcEvent x 1, UnicodeString x 57, Unknown x 79
85 - 100 bytes: TRtcWorkerThread x 1
A memory block has been leaked. The size is: 20
This block was allocated by thread 0x1790, and the stack trace (return addresses) at the time was:
40495A
406083
40665E
799EB2 [rtcSyncObjs.pas][rtcSyncObjs][rtcSyncObjs.TRtcEvent.Create][61]
778D54C4 [ZwClearEvent]
75B6687D [ResetEvent]
7E61B7 [rtcThrPool.pas][rtcThrPool][rtcThrPool.TRtcWorkerThread.Create][926]
7E4EE7 [rtcThrPool.pas][rtcThrPool][rtcThrPool.GetThread][543]
7E5D06 [rtcThrPool.pas][rtcThrPool][rtcThrPool.TRtcThread.PostJob][836]
9552A3 [rtcSocketCliProv.pas][rtcSocketCliProv][rtcSocketCliProv.TRtcSocketClientThread.Create][949]
954807 [rtcSocketCliProv.pas][rtcSocketCliProv][rtcSocketCliProv.TRtcSocketClientProvider.Connect][728]
The block is currently used for an object of class: TRtcEvent
A memory block has been leaked. The size is: 52
This block was allocated by thread 0x668, and the stack trace (return addresses) at the time was:
40495A
407BF3
408080
4090AF
7E6346 [rtcThrPool.pas][rtcThrPool][rtcThrPool.TRtcWorkerThread.Execute][957]
778D65E4 [ZwSetEvent]
75B66804 [SetEvent]
4301D1 [SysUtils][SysUtils][SysUtils.TMultiReadExclusiveWriteSynchronizer.UnblockReaders]
4C4A61 [ExceptionLog.pas][ExceptionLog][ExceptionLog.HookedThreadExecute][16008]
45ADC5 [Classes][Classes][Classes.ThreadProc]
407B3A
The block is currently used for an object of class: UnicodeString
After returning to v436 no any leaks. I am sorry, I have not access now to PRO support as my subscription ends, so I can try only v514.