File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,17 @@ def post(
4545 )
4646 batch_size = batch_size or len (self )
4747
48- if r .scheme .startswith ('jinahub' ):
48+ _scheme = r .scheme
49+ _tls = False
50+
51+ if _scheme in ('grpcs' , 'https' , 'wss' ):
52+ _scheme = _scheme [:- 2 ]
53+ _tls = True
54+
55+ if _scheme == 'ws' :
56+ _scheme = 'websocket' # temp fix for the core
57+
58+ if _scheme .startswith ('jinahub' ):
4959 from jina import Flow
5060
5161 f = Flow (quiet = True , prefetch = 1 ).add (uses = standardized_host )
@@ -57,13 +67,13 @@ def post(
5767 request_size = batch_size ,
5868 parameters = parameters ,
5969 )
60- elif r . scheme in ('grpc' , 'http' , 'ws' ):
70+ elif _scheme in ('grpc' , 'http' , 'ws' , 'websocket ' ):
6171 if _port is None :
6272 raise ValueError (f'can not determine port from { host } ' )
6373
6474 from jina import Client
6575
66- c = Client (host = r .hostname , port = _port , protocol = r . scheme )
76+ c = Client (host = r .hostname , port = _port , protocol = _scheme , https = _tls )
6777 return c .post (
6878 _on ,
6979 inputs = self ,
You can’t perform that action at this time.
0 commit comments