375906 Part.getHeader method not case insensitive
This commit is contained in:
parent
45050ebac9
commit
ec77ba41ef
|
@ -170,7 +170,9 @@ public class MultiPartInputStream
|
|||
*/
|
||||
public String getHeader(String name)
|
||||
{
|
||||
return (String)_headers.getValue(name, 0);
|
||||
if (name == null)
|
||||
return null;
|
||||
return (String)_headers.getValue(name.toLowerCase(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -147,7 +147,7 @@ public class MultiPartInputStreamTest extends TestCase
|
|||
|
||||
Part stuff = mpis.getPart("stuff");
|
||||
assertEquals("text/plain", stuff.getContentType());
|
||||
assertEquals("text/plain", stuff.getHeader("content-type"));
|
||||
assertEquals("text/plain", stuff.getHeader("Content-Type"));
|
||||
assertEquals(1, stuff.getHeaders("content-type").size());
|
||||
assertEquals("form-data; name=\"stuff\"; filename=\"stuff.txt\"", stuff.getHeader("content-disposition"));
|
||||
assertEquals(2, stuff.getHeaderNames().size());
|
||||
|
|
Loading…
Reference in New Issue