We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dac7a1a commit 41a02ccCopy full SHA for 41a02cc
pcap2curl.py
@@ -20,10 +20,11 @@ def payload2curl(p):
20
host_header = re.search("^Host: (.*)", line)
21
host_name = host_header.group(1)
22
23
- if host_name not in url:
24
- url = "http://{}/{}".format(host_name, url)
25
- curl = "curl '{}' \\\n -X {} \\\n".format(url, method)
26
- curl += " \\\n".join(headers)
+ proto_host = 'http://{}/'.format(host_name)
+ if not url.startswith(proto_host):
+ url = "{}{}".format(proto_host, url[1:] if url[0] == "/" else url)
+ curl = "curl '{}' \\\n -X {} \\\n ".format(url, method)
27
+ curl += " \\\n ".join(headers)
28
return curl
29
30
0 commit comments