-
-
Notifications
You must be signed in to change notification settings - Fork 688
Closed
Description
Hello, today I got an issue where undici was throwing an error: InvalidArgumentError: invalid protocol
This turned out to be due to having my http_proxy as http_proxy=proxy.company.com:port
Instead, undici was expecting it to have http:// at the start. http_proxy=http://proxy.company.com:port
Lines 81 to 83 in 4885b11
| if (!/^https?:/.test(url.origin || url.protocol)) { | |
| throw new InvalidArgumentError('invalid protocol') | |
| } |
I was able to figure out the issue by looking at the code, but this is not a good user experience. I've been using my proxy without the http:// prefix for years so this was a bit strange. I don't know enough about this library to say if URLs without http:// or https:// should be accepted, but at the very least there should be a more descriptive error message saying that you're missing the http prefix.
Metadata
Metadata
Assignees
Labels
No labels