fix http request plugin bug

data field overwrite bug
This commit is contained in:
Bastian Schroll 2017-12-19 08:35:10 +01:00
parent dbebc75d82
commit 84932346b5
2 changed files with 11 additions and 5 deletions

4
.gitignore vendored
View file

@ -3,3 +3,7 @@
*.log
config.ini
log/
\.project
\.pydevproject

View file

@ -68,11 +68,13 @@ def run(typ,freq,data):
try:
#
# Replace special characters in data Strings for URL
# Make a copy of the data field to not overwrite the data in it
# Replace special characters in dataCopy Strings for URL
#
for key in data:
if isinstance(data[key], basestring):
data[key] = urllib.quote(data[key])
dataCopy = data
for key in dataCopy:
if isinstance(dataCopy[key], basestring):
dataCopy[key] = urllib.quote(dataCopy[key])
#
# Get URLs
#
@ -90,7 +92,7 @@ def run(typ,freq,data):
# replace wildcards
#
for (i, url) in enumerate(urls):
urls[i] = wildcardHandler.replaceWildcards(urls[i].strip(), data)
urls[i] = wildcardHandler.replaceWildcards(urls[i].strip(), dataCopy)
#
# HTTP-Request
#