connectrpc/connect-es

baseUrl without // leads to HTTP 404 response

timostamm opened this issue · 0 comments

Describe the bug

Using a baseUrl like https:localhost (note the omission of // after https:), leads to an unexpected error [unimplemented] HTTP 404.

To Reproduce

In the example, modify src/client.ts on line 36 to read:

  baseUrl: "https:localhost:8443",

Run npm start for the server and, separately, npm run client. The request will fail with the error message [unimplemented] HTTP 404.

Environment (please complete the following information):

  • @connectrpc/connect-node version: 1.2.0
  • Node.js version: v20.9.0

Additional context
It's unclear why this leads to a HTTP 404. Perhaps the URL is constructed in an unexpected way. It seems that the transport should rather raise an error on the invalid URL instead of issuing an invalid request.