calcRequestFirstLineLength static method
Calculation of the first line which appears in a request. This is mainly influenced
by the method, path and query of the URL.
Implementation
static int calcRequestFirstLineLength(
  String method,
  String path,
  String query,
) {
  final pathInfo = StringBuffer()..write(path.isEmpty ? '/' : path);
  if (query.isNotEmpty) {
    pathInfo.write('?$query');
  }
  return '$method $pathInfo HTTP/1.1'.length;
}