Permalink
Browse files

call to ab was passing -H option even if headers were not supplied

  • Loading branch information...
1 parent 91a9627 commit 80db1604a98e5789e2da0917c5ca0a651a3e4a4a @jamesbloomer jamesbloomer committed with cosmin Feb 25, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 beeswithmachineguns/bees.py
@@ -192,8 +192,9 @@ def _attack(params):
print 'Bee %i is firing his machine gun. Bang bang!' % params['i']
params['header_string'] = '';
- for h in params['headers'].split(';'):
- params['header_string'] += ' -H ' + h
+ if params['headers'] is not '':
+ for h in params['headers'].split(';'):
+ params['header_string'] += ' -H ' + h
stdin, stdout, stderr = client.exec_command('ab -r -n %(num_requests)s -c %(concurrent_requests)s -C "sessionid=NotARealSessionID" %(header_string)s "%(url)s"' % params)

0 comments on commit 80db160

Please sign in to comment.