avoided NPE in example
This commit is contained in:
parent
90110659e2
commit
a32e3a2091
|
@ -179,8 +179,10 @@ public class Http2Server
|
|||
content+="session="+session.getId()+(session.isNew()?"(New)\n":"\n");
|
||||
content+="date="+new Date()+"\n";
|
||||
|
||||
for (Cookie c : request.getCookies())
|
||||
content+="cookie "+c.getName()+"="+c.getValue()+"\n";
|
||||
Cookie[] cookies = request.getCookies();
|
||||
if (cookies!=null && cookies.length>0)
|
||||
for (Cookie c : cookies)
|
||||
content+="cookie "+c.getName()+"="+c.getValue()+"\n";
|
||||
|
||||
response.setContentLength(content.length());
|
||||
response.getOutputStream().print(content);
|
||||
|
|
Loading…
Reference in New Issue