Fix crash when using body filters (#2744)

fix crash when using body filters

They still don't work, but at least the web interface won't crash.
This commit is contained in:
Wouter Visser 2018-01-02 16:37:32 +01:00 committed by Maximilian Hils
parent 68c32d8627
commit 828e1a87ca
2 changed files with 7 additions and 7 deletions

View file

@ -1929,7 +1929,7 @@ module.exports = (function() {
function body(regex){
regex = new RegExp(regex, "i");
function bodyFilter(flow){
return True;
return true;
}
bodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
return bodyFilter;
@ -1937,7 +1937,7 @@ module.exports = (function() {
function requestBody(regex){
regex = new RegExp(regex, "i");
function requestBodyFilter(flow){
return True;
return true;
}
requestBodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
return requestBodyFilter;
@ -1945,7 +1945,7 @@ module.exports = (function() {
function responseBody(regex){
regex = new RegExp(regex, "i");
function responseBodyFilter(flow){
return True;
return true;
}
responseBodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
return responseBodyFilter;
@ -2104,4 +2104,4 @@ module.exports = (function() {
SyntaxError: peg$SyntaxError,
parse: peg$parse
};
})();
})();

View file

@ -72,7 +72,7 @@ function responseCode(code){
function body(regex){
regex = new RegExp(regex, "i");
function bodyFilter(flow){
return True;
return true;
}
bodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
return bodyFilter;
@ -80,7 +80,7 @@ function body(regex){
function requestBody(regex){
regex = new RegExp(regex, "i");
function requestBodyFilter(flow){
return True;
return true;
}
requestBodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
return requestBodyFilter;
@ -88,7 +88,7 @@ function requestBody(regex){
function responseBody(regex){
regex = new RegExp(regex, "i");
function responseBodyFilter(flow){
return True;
return true;
}
responseBodyFilter.desc = "body filters are not implemented yet, see https://github.com/mitmproxy/mitmweb/issues/10";
return responseBodyFilter;