@@ -155,7 +155,7 @@ def mixPayload(url, payloads, scope=[], append=False):
155155 :param url: Generic URL.
156156 :param payloads: Payloads list
157157 :param scope: [optional] list, e.g. [params, path, query, fragment]
158- :param append: append payload for query and fragment, default is replace
158+ :param append: append payload for params/ query/ fragment, default is replace
159159 :return: list
160160 '''
161161
@@ -171,7 +171,10 @@ def mixPayload(url, payloads, scope=[], append=False):
171171
172172 for p in payloads :
173173 if (not scope or 'params' in scope ) and u .params :
174- result .add (urlunparse ([u .scheme , u .netloc , u .path , p , u .query , u .fragment ]))
174+ if append :
175+ result .add (urlunparse ([u .scheme , u .netloc , u .path , u .params + p , u .query , u .fragment ]))
176+ else :
177+ result .add (urlunparse ([u .scheme , u .netloc , u .path , p , u .query , u .fragment ]))
175178
176179
177180 if not scope or 'path' in scope :
@@ -187,10 +190,8 @@ def mixPayload(url, payloads, scope=[], append=False):
187190 if not scope or 'query' in scope :
188191 for k in qs_dict .keys ():
189192 tmp_dict = copy .deepcopy (qs_dict )
190- if append :
191- tmp_dict [k ] = tmp_dict [k ] + p
192- else :
193- tmp_dict [k ] = p
193+ tmp_dict [k ] = tmp_dict [k ] + p if append else p
194+
194195 tmp_qs = unquote (urlencode (tmp_dict ))
195196
196197 result .add (urlunparse ([u .scheme , u .netloc , u .path , u .params , tmp_qs , u .fragment ]))
0 commit comments