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)
{
return new String[]
{ null };
return new String[] {};
}
protocol = protocol.trim();
if ((protocol == null) || (protocol.length() == 0))
{
return new String[]
{ null };
return new String[] {};
}
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);
return protocols;
}