We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc9b238 commit 3690354Copy full SHA for 3690354
lightbug_http/client.mojo
@@ -62,7 +62,17 @@ struct Client:
62
is_tls = True
63
scheme = Scheme.HTTPS
64
65
- port = request.uri.port.value() if request.uri.port else 80
+ var port: UInt16
66
+ if request.uri.port:
67
+ port = request.uri.port.value()
68
+ else:
69
+ if request.uri.scheme == Scheme.HTTP.value:
70
+ port = 80
71
+ elif request.uri.scheme == Scheme.HTTPS.value:
72
+ port = 443
73
74
+ raise Error("Client.do: Invalid scheme received in the URI.")
75
+
76
var pool_key = PoolKey(request.uri.host, port, scheme)
77
var cached_connection = False
78
var conn: TCPConnection
0 commit comments