Skip to content
Permalink
Browse files

Compute the Content-Length header in the client-side (get, post, stream)

  • Loading branch information...
cvaroqui committed Jun 28, 2019
1 parent ab0bafb commit c22a7b654588af68170c7057df20f8d5dd87d204
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/comm.py
@@ -705,6 +705,7 @@ def h2_daemon_get(self, data, server=None, node=None, with_result=True, silent=F
path = self.h2_path_from_data(data)
headers = self.h2_headers(node=node, secret=secret, af=sp.af)
body = self.h2_body_from_data(data)
headers["Content-Length"] = str(len(body))
conn = self.h2c(sp=sp)
method = "GET"
try:
@@ -861,6 +862,7 @@ def h2_daemon_stream_conn(self, data, server=None, node=None, cluster_name=None,
path = self.h2_path_from_data(data)
headers = self.h2_headers(node=node, secret=secret, af=sp.af)
body = self.h2_body_from_data(data)
headers["Content-Length"] = str(len(body))
conn = self.h2c(sp=sp, enable_push=True)
stream_id = conn.request("GET", path, headers=headers, body=body)
#data = resp.read()

0 comments on commit c22a7b6

Please sign in to comment.
You can’t perform that action at this time.