improve some websocket error messages + add a utility function with unittest to parse status line and stop using scanf which triggers warnings on Windows

This commit is contained in:
Benjamin Sergeant
2019-09-09 21:23:57 -07:00
parent 6c0890594b
commit 64d3c99f99
6 changed files with 55 additions and 7 deletions

View File

@ -681,8 +681,12 @@ namespace ix
reason = WebSocketCloseConstants::kInvalidFramePayloadDataMessage;
}
//
// Validate close codes. Autobahn 7.9.*
// 1014, 1015 are debattable. The firefox MSDN has a description for them
// 1014, 1015 are debattable. The firefox MSDN has a description for them.
// Full list of status code and status range is defined in the dedicated
// RFC section at https://tools.ietf.org/html/rfc6455#page-45
//
if (code < 1000 || code == 1004 || code == 1006 ||
(code > 1013 && code < 3000))
{