httpserver icon indicating copy to clipboard operation
httpserver copied to clipboard

HTTPS Stream: first character is missing (HTTP Method)

Open kbalint opened this issue 6 years ago • 0 comments

Hello, I've found a bug in the HttpServer, which only affects the usage when HTTPS mode is enabled. If a HTTPS connection is created, in HttpContext.cs -s OnReceive function in the first call only the first byte of the stream arrives (for example: 'G' in 'GET /test HTTP/1.1').

Then it will fail to copy this value to _buffer (i don't really understand that part of the code and the recursion), so in the upper levels all Method names are truncated: 'ET', 'PTIONS' etc. There was (and should have been) a check for Method value in HttpParser.cs but it has been removed.

In the original version there was a comment about a not traced bug in this function, I think this is it. I could no debug it further what is the root cause of this problem. Do you have any hints how to continue with the debug? Thanks

kbalint avatar Sep 25 '18 14:09 kbalint