better code injection handling for python

This commit is contained in:
wing328
2016-06-28 17:07:50 +08:00
parent 8dc22d2bda
commit 3a41da42f0
74 changed files with 3617 additions and 54 deletions

View File

@@ -590,5 +590,16 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
p.example = example;
}
@Override
public String escapeQuotationMark(String input) {
// remove ' to avoid code injection
return input.replace("'", "");
}
@Override
public String escapeUnsafeCharacters(String input) {
// remove multiline comment
return input.replace("'''", "");
}
}