286535 ContentExchange status code
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@720 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
5bc91e048b
commit
024df7b64e
|
@ -1,6 +1,7 @@
|
||||||
jetty-7.0.0.RC4-SNAPSHOT
|
jetty-7.0.0.RC4-SNAPSHOT
|
||||||
+ 286185 Implement ability for JSON implementation to automatically register convertors
|
+ 286185 Implement ability for JSON implementation to automatically register convertors
|
||||||
+ Added discoverable start options
|
+ Added discoverable start options
|
||||||
|
+ 286535 ContentExchange status code
|
||||||
|
|
||||||
jetty-7.0.0.RC3 7 August 2009
|
jetty-7.0.0.RC3 7 August 2009
|
||||||
+ 277403 remove system properties
|
+ 277403 remove system properties
|
||||||
|
|
|
@ -62,25 +62,17 @@ public class ContentExchange extends CachedExchange
|
||||||
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
|
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
|
||||||
{
|
{
|
||||||
super.onResponseHeader(name,value);
|
super.onResponseHeader(name,value);
|
||||||
int header = HttpHeaders.CACHE.getOrdinal(value);
|
int header = HttpHeaders.CACHE.getOrdinal(name);
|
||||||
switch (header)
|
switch (header)
|
||||||
{
|
{
|
||||||
case HttpHeaders.CONTENT_LENGTH_ORDINAL:
|
case HttpHeaders.CONTENT_LENGTH_ORDINAL:
|
||||||
_contentLength = BufferUtil.toInt(value);
|
_contentLength = BufferUtil.toInt(value);
|
||||||
break;
|
break;
|
||||||
case HttpHeaders.CONTENT_TYPE_ORDINAL:
|
case HttpHeaders.CONTENT_TYPE_ORDINAL:
|
||||||
|
|
||||||
String mime = StringUtil.asciiToLowerCase(value.toString());
|
String mime = StringUtil.asciiToLowerCase(value.toString());
|
||||||
int i = mime.indexOf("charset=");
|
int i = mime.indexOf("charset=");
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
_encoding = mime.substring(i + 8);
|
||||||
mime = mime.substring(i + 8);
|
|
||||||
i = mime.indexOf(';');
|
|
||||||
if (i > 0)
|
|
||||||
mime = mime.substring(0,i);
|
|
||||||
}
|
|
||||||
if (mime != null && mime.length() > 0)
|
|
||||||
_encoding = mime;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue