Skip to content

Commit

Permalink
Merge pull request #87 from lostsnow/fix/req-resp-header-format
Browse files Browse the repository at this point in the history
fixes request and response header format
  • Loading branch information
lostsnow authored Dec 23, 2021
2 parents c24e2df + 45af764 commit c928ff6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dongtai_agent_python/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@scope.with_scope(scope.SCOPE_AGENT)
def normalize_response_header(status_line, headers):
header_str = status_line + "\n" + json_to_str(headers)
header_str = status_line + "\r\n" + json_to_str(headers)
header_str = base64.b64encode(header_str.encode('utf-8'))
header_str = bytes.decode(header_str, 'utf-8')
return header_str
Expand All @@ -33,8 +33,8 @@ def json_to_str(json_data):
if json_data:
new_list = []
for item in json_data.keys():
new_list.append(str(item) + "=" + str(json_data[item]))
json_data = "\n".join(new_list)
new_list.append(str(item) + ": " + str(json_data[item]))
json_data = "\r\n".join(new_list)
return json_data


Expand Down

0 comments on commit c928ff6

Please sign in to comment.