Add function to register functions that verifies WebSocket upgrades
The current implementation creates WebSocket connections if a user
sends a request with the upgrade header set to WebSocket and if
there is a handler.
Decouple the routes from the handlers by adding a function to
register callback functions that take a QHttpServerRequest as an
argument and return a QHttpServerWebSocketUpgradeResponse which
can have the types Allow, Deny, and PassToNext. The first Allow
or Deny returned by the callback functions decides the outcome,
while PassToNext is used to execute the next rule. If no callback
functions are registered or all return PassToNext the WebSocket
upgrade fails and missingHandler is executed. It is possible to
customize the status code and message returned when the upgrade
by the handler that has the type Deny.
[ChangeLog][QAbstractHttpServer] Add function to register
callback functions that verifies WebSocket upgrades
Fixes: QTBUG-121462
Change-Id: I5ea2a778f128b2e4212da551c4d96bf25d8576e8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>