Skip to content

Commit

Permalink
fixed Insert html code into js and css files PumpkiProxy P0cL4bs#463
Browse files Browse the repository at this point in the history
  • Loading branch information
mh4x0f committed Mar 13, 2019
1 parent 07cbb73 commit a4a71e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Version 0.8.7
- fixed No pyOpenSSL installed, no access internet #472
- fixed DHCP settings unchangeable after first starting #471
- fixed DHCP configuration file for pyDHCPServer and IscDHCPServer #475
- fixed Insert html code into js and css files PumpkiProxy #463

Version 0.8.5
-------------
Expand Down
1 change: 1 addition & 0 deletions core/config/commits/Lcommits.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ master:
{ changelog : 'fixed No pyOpenSSL installed, no access internet #472'},
{ changelog : 'fixed DHCP settings unchangeable after first starting #471'},
{ changelog : 'fixed DHCP configuration file for pyDHCPServer and IscDHCPServer #475'},
{ changelog : 'fixed Insert html code into js and css files PumpkiProxy #463'},

]

Expand Down
3 changes: 2 additions & 1 deletion plugins/extension/js_inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self):
for key,value in self.meta.items():
self.__dict__[key] = value
self.ConfigParser = True
self.exclude_extension = ('.css', '.js')
self.url = self.config.get_setting('set_js_inject','url')

def request(self, flow):
Expand All @@ -46,7 +47,7 @@ def response(self,flow):
if "Content-Security-Policy" in flow.response.headers:
del flow.response.headers["Content-Security-Policy"]
"""
if html.body:
if html.body and not flow.request.path.endswith(self.exclude_extension):
url = '{}'.format(flow.request.pretty_host)
metatag = html.new_tag('script')
metatag.attrs['src'] = self.url
Expand Down

0 comments on commit a4a71e5

Please sign in to comment.