Skip to content

Commit

Permalink
update: Header里面不应该放非String值
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Apr 27, 2020
1 parent 36f3e28 commit 8d2cfff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/org/nutz/http/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ public Set<Entry<String, String>> getAll() {
}

public Header addAll(Map<String, String> map) {
if (null != map)
items.putAll(map);
if (null != map) {
for (Map.Entry<String, String> en : map.entrySet()) {
if (en.getValue() != null) // 如果值不是String,就立马报错咯
this.items.put(en.getKey(), en.getKey());
}
}
return this;
}

Expand Down

0 comments on commit 8d2cfff

Please sign in to comment.