File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
st2client/st2client/utils Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1- # Copyright 2020 The StackStorm Authors.
1+ # Copyright 2020-2026 The StackStorm Authors.
22# Copyright 2019 Extreme Networks, Inc.
33#
44# Licensed under the Apache License, Version 2.0 (the "License");
1717
1818import json
1919import logging
20- from pipes import quote as pquote
20+ from shlex import quote
2121
2222import requests
2323
@@ -185,18 +185,18 @@ def _get_curl_line_for_request(self, request):
185185 if method in ["HEAD" ]:
186186 parts .extend (["--head" ])
187187 else :
188- parts .extend (["-X" , pquote (method )])
188+ parts .extend (["-X" , quote (method )])
189189
190190 # headers
191191 for key , value in request .headers .items ():
192- parts .extend (["-H " , pquote ("%s: %s" % (key , value ))])
192+ parts .extend (["-H " , quote ("%s: %s" % (key , value ))])
193193
194194 # body
195195 if request .body :
196- parts .extend (["--data-binary" , pquote (request .body )])
196+ parts .extend (["--data-binary" , quote (request .body )])
197197
198198 # URL
199- parts .extend ([pquote (request .url )])
199+ parts .extend ([quote (request .url )])
200200
201201 curl_line = " " .join (parts )
202202 return curl_line
You can’t perform that action at this time.
0 commit comments