Skip to content

Commit f5c3177

Browse files
committed
Server:解决head请求在@column校验未加isPrepared条件,以及有多个字段时出现的兼容问题
1 parent db0a2d0 commit f5c3177

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server/AbstractSQLConfig.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,10 @@ public AbstractSQLConfig setColumn(String column) {
348348
public String getColumnString() throws NotExistException {
349349
switch (getMethod()) {
350350
case HEAD:
351-
case HEADS:
352-
if (StringUtil.isEmpty(column, true) == false && StringUtil.isName(column) == false) {
353-
throw new IllegalArgumentException("HEAD请求: @column:value 中 value必须是1个单词!");
351+
case HEADS: //StringUtil.isEmpty(column, true) || column.contains(",") 时SQL.count(column)会return "*"
352+
if (isPrepared() && StringUtil.isEmpty(column, true) == false
353+
&& column.contains(",") == false && StringUtil.isName(column) == false) {
354+
throw new IllegalArgumentException("HEAD请求: @column:value 中 value里面用 , 分割的每一项都必须是1个单词!");
354355
}
355356
return SQL.count(column);
356357
case POST:

0 commit comments

Comments
 (0)