Commit 3c0d7031 authored by 张永's avatar 张永

空值参与签名

parent ddbe93eb
...@@ -283,17 +283,18 @@ public class HttpUtil { ...@@ -283,17 +283,18 @@ public class HttpUtil {
Object val = parameters.get(key); Object val = parameters.get(key);
String sKey = String.valueOf(key); String sKey = String.valueOf(key);
Object[] sVals = (val == null ? null : (val instanceof Object[] ? (Object[]) val : (val instanceof Collection<?> ? ((Collection<?>)val).toArray() : new Object[] { val }))); Object[] sVals = (val == null ? null : (val instanceof Object[] ? (Object[]) val : (val instanceof Collection<?> ? ((Collection<?>)val).toArray() : new Object[] { val })));
if (sVals != null && sVals.length > 0) { if (sVals != null && sVals.length > 0) {
for (Object sVal : sVals) { for (Object sVal : sVals) {
if(StringUtil.isNotEmpty(sVal)) { if(StringUtil.isNotEmpty(sVal)) {
params.add(sKey + "=" +sVal); params.add(sKey + "=" +sVal);
}
}
} else { } else {
params.add(sKey + "="); //空值 参与签名 字节跳动 params.add(sKey + "="); //空值 参与签名 字节跳动
} }
} }
} }
}
}
return StringUtil.join("&", params); return StringUtil.join("&", params);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment