Skip to content
Browse files

Add xml flows. Update JSFlow to handle JSON.

  • Loading branch information...
1 parent 1e7902f commit 25eacc5ad2b82a1505299c44b536d39d96856472 @mhils committed
Showing with 15 additions and 2 deletions.
  1. +1 −0 gui/index.html
  2. +2 −2 gui/js/honeyproxy/flows/JsFlow.js
  3. +12 −0 gui/js/honeyproxy/flows/XmlFlow.js
View
1 gui/index.html
@@ -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>
View
4 gui/js/honeyproxy/flows/JsFlow.js
@@ -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);
View
12 gui/js/honeyproxy/flows/XmlFlow.js
@@ -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.
Something went wrong with that request. Please try again.