File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,19 @@ struct MojoClient(Client):
7474 if uri.is_https():
7575 is_tls = True
7676
77- var host_port = host.split(" :" )
78- var host_str = host_port[0 ]
79- var port = atol(host_port[1 ])
77+ var host_str : String
78+ var port : Int
79+
80+ if host.__contains__ (" :" ):
81+ var host_port = host.split(" :" )
82+ host_str = host_port[0 ]
83+ port = atol(host_port[1 ])
84+ else :
85+ host_str = host
86+ if is_tls:
87+ port = 443
88+ else :
89+ port = 80
8090
8191 var conn = create_connection(self .fd, host_str, port)
8292
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ from lightbug_http.tests.utils import (
1010 getRequest,
1111)
1212
13+
1314fn test_mojo_client_lightbug (client : MojoClient) raises :
1415 var res = client.do(
1516 HTTPRequest(
@@ -26,6 +27,7 @@ fn test_mojo_client_lightbug(client: MojoClient) raises:
2627 ),
2728 )
2829
30+
2931fn test_python_client_lightbug (client : PythonClient) raises :
3032 var res = client.do(
3133 HTTPRequest(
You can’t perform that action at this time.
0 commit comments