Skip to content

Commit

Permalink
Add xml flows. Update JSFlow to handle JSON.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed Jul 12, 2012
1 parent 1e7902f commit 25eacc5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ <h2 class=title><%- getFilename() %></h2>
<script src="./js/honeyproxy/flows/PrettyFlow.js"></script>
<script src="./js/honeyproxy/flows/CssFlow.js"></script>
<script src="./js/honeyproxy/flows/JsFlow.js"></script>
<script src="./js/honeyproxy/flows/XmlFlow.js"></script>
<script src="./js/honeyproxy/flows/HtmlFlow.js"></script>
<script src="./js/honeyproxy/flows/ImageFlow.js"></script>
<script src="./js/honeyproxy/Traffic.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions gui/js/honeyproxy/flows/JsFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ HoneyProxy.JSFlow = HoneyProxy.PrettyFlow.extend({
}
}, {matches: function(data){
if(data.contentType)
return !!data.contentType.match(/javascript/i);
return !!data.contentType.match(/(javascript|json)/i);
else if(data.path)
return !!data.path.match(/\.js$/i);
return !!data.path.match(/(\.js|\.json)$/i);
return false;
}});
HoneyProxy.flowModels.unshift(HoneyProxy.JSFlow);
12 changes: 12 additions & 0 deletions gui/js/honeyproxy/flows/XmlFlow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
HoneyProxy.XmlFlow = HoneyProxy.PrettyFlow.extend({
/*getCategory: function(){
return "xml";
}*/
}, {matches: function(data){
if(data.contentType)
return !!data.contentType.match(/xml/i);
else if(data.path)
return !!data.path.match(/\.xml/i);
return false;
}});
HoneyProxy.flowModels.unshift(HoneyProxy.XmlFlow);

0 comments on commit 25eacc5

Please sign in to comment.