Kennysan / CSPTools

Content Security Policy Creation tools
MIT License
35 stars 6 forks source link

AttributeError: 'Headers' object has no attribute 'add' #6

Open arthurzenika opened 8 years ago

arthurzenika commented 8 years ago
'Headers' object has no attribute 'add'
Traceback (most recent call last):
  File "run.py", line 45, in <module>
    p.run()
  File "/home/arthur/local/CSPTools/proxy/CSPProxy.py", line 62, in run
    self.proxy.run()
  File "/home/arthur/local/CSPTools/proxy/CSPProxy.py", line 28, in run
    flow.FlowMaster.run(self)
  File "/home/arthur/.virtualenvs/csptool/local/lib/python2.7/site-packages/libmproxy/controller.py", line 128, in run
    self.tick(self.masterq, 0.1)
  File "/home/arthur/.virtualenvs/csptool/local/lib/python2.7/site-packages/libmproxy/flow.py", line 820, in tick
    return super(FlowMaster, self).tick(q, timeout)
  File "/home/arthur/.virtualenvs/csptool/local/lib/python2.7/site-packages/libmproxy/controller.py", line 113, in tick
    self.handle(*msg)
  File "/home/arthur/.virtualenvs/csptool/local/lib/python2.7/site-packages/libmproxy/controller.py", line 135, in handle
    m(obj)
  File "/home/arthur/local/CSPTools/proxy/CSPProxy.py", line 50, in handle_response
    f.response.headers.add("Content-Security-Policy-Report-Only", self.policy + "report-uri " +self.reporturi);
AttributeError: 'Headers' object has no attribute 'add'

problem with new version of mitmproxy (0.16) ?

arthurzenika commented 8 years ago

Downgrading to mitmproxy (0.13) seems to get it to work.