Added some comments in the connect middleware; Fixed the tests for connect middleware to match the changes

Signed-off-by: license2e <ilya@shindyapin.com>