Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
userpj committed Jul 15, 2024
1 parent 5cf4f79 commit c3361e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions appbuilder/core/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ def build_curl(self, request: requests.PreparedRequest) -> str:
Generate cURL command from prepared request object.
"""
curl = "curl -X {0} -L '{1}' \\\n".format(request.method, request.url)
headers = ["-H '{0}: {1}' \\".format(k, v)
for k, v in request.headers.items() if k != 'Content-Length']

headers = [
"-H '{0}: {1}' \\".format(k, v)
for k, v in request.headers.items()
if k != "Content-Length"
]

if headers:
headers[-1] = headers[-1].rstrip(" \\")
curl += "\n".join(headers)
Expand Down

0 comments on commit c3361e7

Please sign in to comment.