Skip to content

Commit

Permalink
Server:解决head请求在@column校验未加isPrepared条件,以及有多个字段时出现的兼容问题
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLemon committed May 13, 2018
1 parent db0a2d0 commit f5c3177
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,10 @@ public AbstractSQLConfig setColumn(String column) {
public String getColumnString() throws NotExistException {
switch (getMethod()) {
case HEAD:
case HEADS:
if (StringUtil.isEmpty(column, true) == false && StringUtil.isName(column) == false) {
throw new IllegalArgumentException("HEAD请求: @column:value 中 value必须是1个单词!");
case HEADS: //StringUtil.isEmpty(column, true) || column.contains(",") 时SQL.count(column)会return "*"
if (isPrepared() && StringUtil.isEmpty(column, true) == false
&& column.contains(",") == false && StringUtil.isName(column) == false) {
throw new IllegalArgumentException("HEAD请求: @column:value 中 value里面用 , 分割的每一项都必须是1个单词!");
}
return SQL.count(column);
case POST:
Expand Down

0 comments on commit f5c3177

Please sign in to comment.