Fixed converstion to lower case by using StringUtil.asciiToLowerCase method.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2018-03-27 12:02:10 +11:00
parent 115c280b88
commit 9557f02fea
1 changed files with 4 additions and 4 deletions

View File

@ -201,7 +201,7 @@ public class MultiPartFormInputStream
{ {
if (name == null) if (name == null)
return null; return null;
return _headers.getValue(name.toLowerCase(Locale.ENGLISH),0); return _headers.getValue(StringUtil.asciiToLowerCase(name),0);
} }
/** /**
@ -628,7 +628,7 @@ public class MultiPartFormInputStream
public void parsedField(String key, String value) public void parsedField(String key, String value)
{ {
// Add to headers and mark if one of these fields. // // Add to headers and mark if one of these fields. //
headers.put(key.toLowerCase(Locale.ENGLISH),value); headers.put(StringUtil.asciiToLowerCase(key),value);
if (key.equalsIgnoreCase("content-disposition")) if (key.equalsIgnoreCase("content-disposition"))
contentDisposition = value; contentDisposition = value;
else if (key.equalsIgnoreCase("content-type")) else if (key.equalsIgnoreCase("content-type"))
@ -657,7 +657,7 @@ public class MultiPartFormInputStream
while (tok.hasMoreTokens()) while (tok.hasMoreTokens())
{ {
String t = tok.nextToken().trim(); String t = tok.nextToken().trim();
String tl = t.toLowerCase(Locale.ENGLISH); String tl = StringUtil.asciiToLowerCase(t);
if (t.startsWith("form-data")) if (t.startsWith("form-data"))
form_data = true; form_data = true;
else if (tl.startsWith("name=")) else if (tl.startsWith("name="))
@ -708,7 +708,7 @@ public class MultiPartFormInputStream
@Override @Override
public boolean content(ByteBuffer buffer, boolean last) public boolean content(ByteBuffer buffer, boolean last)
{ {
if (BufferUtil.hasContent(buffer)) if (BufferUtil.hasContent(buffer))
{ {
try try