Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockAttackInnerInterceptor 自定义Sql出现换行符,优化 #6168

Closed
ryanSir opened this issue May 15, 2024 · 1 comment
Closed

BlockAttackInnerInterceptor 自定义Sql出现换行符,优化 #6168

ryanSir opened this issue May 15, 2024 · 1 comment

Comments

@ryanSir
Copy link

ryanSir commented May 15, 2024

请详细描述需要增加的功能
@OverRide
public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) {
PluginUtils.MPStatementHandler handler = PluginUtils.mpStatementHandler(sh);
MappedStatement ms = handler.mappedStatement();
SqlCommandType sct = ms.getSqlCommandType();
if (sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) {
if (InterceptorIgnoreHelper.willIgnoreBlockAttack(ms.getId())) {
return;
}
BoundSql boundSql = handler.boundSql();
String sql = boundSql.getSql();
parserMulti(sql.replace("\n", ""), null);
}
}

@nieqiurong
Copy link
Contributor

#6187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants