Skip to content

CORS not supported on a Dart server #611

@Levi-Lesches

Description

@Levi-Lesches

When using package:grpc on a Dart server, you make a Server and then call server.serve(). This server cannot handle CORS requests in the way package:shelf can, and so all requests from the Flutter side are broken.

grpc version: v3.1.0

Repro steps

// LoginService is a regular rpc service
void main() async {
  final server = Server([LoginService()]);
  await server.serve(port: 9000);
  print("Server running on http://localhost:9000");
}

Expected result: Sending requests to this server works

Actual result:

gRPC Error (code: 2, codeName: UNKNOWN, message: HTTP request completed without a status (potential CORS issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions