diff --git a/docarray/array/mixins/post.py b/docarray/array/mixins/post.py index 3a8932822c0..c36e3b72c37 100644 --- a/docarray/array/mixins/post.py +++ b/docarray/array/mixins/post.py @@ -45,7 +45,17 @@ def post( ) batch_size = batch_size or len(self) - if r.scheme.startswith('jinahub'): + _scheme = r.scheme + _tls = False + + if _scheme in ('grpcs', 'https', 'wss'): + _scheme = _scheme[:-2] + _tls = True + + if _scheme == 'ws': + _scheme = 'websocket' # temp fix for the core + + if _scheme.startswith('jinahub'): from jina import Flow f = Flow(quiet=True, prefetch=1).add(uses=standardized_host) @@ -57,13 +67,13 @@ def post( request_size=batch_size, parameters=parameters, ) - elif r.scheme in ('grpc', 'http', 'ws'): + elif _scheme in ('grpc', 'http', 'ws', 'websocket'): if _port is None: raise ValueError(f'can not determine port from {host}') from jina import Client - c = Client(host=r.hostname, port=_port, protocol=r.scheme) + c = Client(host=r.hostname, port=_port, protocol=_scheme, https=_tls) return c.post( _on, inputs=self,