parse HTTP headers without asking for them again by Slawomir2 · Pull Request #1837 · microsoft/cpprestsdk
This fixes issue #1212
The old code was calling WinHttpQueryHeaders 2nd time but that was sometimes resulting in headers not being found in case the request_handle was reset in the meantime
WinHttpQueryHeaders would then return false and GetLastError() would return ERROR_INVALID_HANDLE.
Eventually application would crash due to uncaught exception thrown by stoi() function when it was passed an empty string (exit code 0xc0000409 which does not necessarily mean stack overflow