Fixing parseProtocols

This commit is contained in:
Joakim Erdfelt 2013-06-14 07:40:02 -07:00
parent 83bd15559b
commit f34ac9b920
1 changed files with 3 additions and 5 deletions

View File

@ -248,17 +248,15 @@ public class ServletUpgradeRequest extends UpgradeRequest
{ {
if (protocol == null) if (protocol == null)
{ {
return new String[] return new String[] {};
{ null };
} }
protocol = protocol.trim(); protocol = protocol.trim();
if ((protocol == null) || (protocol.length() == 0)) if ((protocol == null) || (protocol.length() == 0))
{ {
return new String[] return new String[] {};
{ null };
} }
String[] passed = protocol.split("\\s*,\\s*"); String[] passed = protocol.split("\\s*,\\s*");
String[] protocols = new String[passed.length + 1]; String[] protocols = new String[passed.length];
System.arraycopy(passed,0,protocols,0,passed.length); System.arraycopy(passed,0,protocols,0,passed.length);
return protocols; return protocols;
} }