Issue #3681
updates from review Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
parent
4dc004cf96
commit
53dc425bde
|
@ -66,7 +66,7 @@ public class HttpFields implements Iterable<HttpField>
|
||||||
*/
|
*/
|
||||||
public HttpFields()
|
public HttpFields()
|
||||||
{
|
{
|
||||||
this(16 ); // TODO tune default. Currently based on small same of Chrome requests.
|
this(16); // TODO tune default. Currently based on small sample of Chrome requests.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,7 +116,7 @@ public class HttpFields implements Iterable<HttpField>
|
||||||
|
|
||||||
public Stream<HttpField> stream()
|
public Stream<HttpField> stream()
|
||||||
{
|
{
|
||||||
return Arrays.stream(_fields).filter(f->f!=null);
|
return Arrays.stream(_fields).limit(_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -666,13 +666,11 @@ public class Request implements HttpServletRequest
|
||||||
{
|
{
|
||||||
if (_characterEncoding==null)
|
if (_characterEncoding==null)
|
||||||
{
|
{
|
||||||
if (_contentType==null)
|
String contentType = getContentType();
|
||||||
getContentType();
|
if (contentType!=null)
|
||||||
if (_contentType!=null)
|
|
||||||
{
|
{
|
||||||
|
MimeTypes.Type mime = MimeTypes.CACHE.get(contentType);
|
||||||
MimeTypes.Type mime = MimeTypes.CACHE.get(_contentType);
|
String charset = (mime == null || mime.getCharset() == null) ? MimeTypes.getCharsetFromContentType(contentType) : mime.getCharset().toString();
|
||||||
String charset = (mime == null || mime.getCharset() == null) ? MimeTypes.getCharsetFromContentType(_contentType) : mime.getCharset().toString();
|
|
||||||
if (charset != null)
|
if (charset != null)
|
||||||
_characterEncoding=charset;
|
_characterEncoding=charset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue