Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpException: Connection closed before full header was received #298

Open
lindeer opened this issue May 17, 2024 · 0 comments
Open

HttpException: Connection closed before full header was received #298

lindeer opened this issue May 17, 2024 · 0 comments

Comments

@lindeer
Copy link

lindeer commented May 17, 2024

firefox: 117.0
geckodriver: 0.34.0
OS: fedora 38

  final proc = await Process.start(
      'geckodriver',
      ['--port=4445'],
    );
  final lines = proc.stdout.transform(utf8.decoder).transform(LineSplitter());
  await for (final line in lines) {
    if (line.contains('127.0.0.1:4445')) {
      break;
    }
  }
  final opts = Map.of(drv.Capabilities.firefox);
  final driver = await drv.createDriver(
    uri: Uri.parse('http://localhost:4445/'),
    desired: opts,
    spec: drv.WebDriverSpec.W3c,
  );

error happened:

Unhandled exception:
HttpException: Connection closed before full header was received, uri = http://localhost:4445/session

but when I changed await for as follow, everything is OK, have no idea why:

  final c = Completer();
  lines.listen((line) {
    if (line.contains('127.0.0.1:4445')) {
      c.complete();
    }
  });

  if (!c.isCompleted) {
    await c.future;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant