Ignore null-keyed entries when iterating through the response headers
This commit is contained in:
parent
5edd774fc4
commit
f66c20de54
1 changed files with 2 additions and 1 deletions
|
@ -68,7 +68,8 @@ public class Response {
|
|||
@Nullable
|
||||
public String getHeader(String name) {
|
||||
for (Map.Entry<String, List<String>> headerEntry : responseHeaders.entrySet()) {
|
||||
if (headerEntry.getKey().equalsIgnoreCase(name)) {
|
||||
final String key = headerEntry.getKey();
|
||||
if (key != null && key.equalsIgnoreCase(name)) {
|
||||
if (headerEntry.getValue().size() > 0) {
|
||||
return headerEntry.getValue().get(0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue