Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions docarray/array/mixins/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down