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:
Greg Wilkins 2009-08-13 23:58:17 +00:00
parent 5bc91e048b
commit 024df7b64e
2 changed files with 3 additions and 10 deletions

View File

@ -1,6 +1,7 @@
jetty-7.0.0.RC4-SNAPSHOT
+ 286185 Implement ability for JSON implementation to automatically register convertors
+ Added discoverable start options
+ 286535 ContentExchange status code
jetty-7.0.0.RC3 7 August 2009
+ 277403 remove system properties

View File

@ -62,25 +62,17 @@ public class ContentExchange extends CachedExchange
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
{
super.onResponseHeader(name,value);
int header = HttpHeaders.CACHE.getOrdinal(value);
int header = HttpHeaders.CACHE.getOrdinal(name);
switch (header)
{
case HttpHeaders.CONTENT_LENGTH_ORDINAL:
_contentLength = BufferUtil.toInt(value);
break;
case HttpHeaders.CONTENT_TYPE_ORDINAL:
String mime = StringUtil.asciiToLowerCase(value.toString());
int i = mime.indexOf("charset=");
if (i > 0)
{
mime = mime.substring(i + 8);
i = mime.indexOf(';');
if (i > 0)
mime = mime.substring(0,i);
}
if (mime != null && mime.length() > 0)
_encoding = mime;
_encoding = mime.substring(i + 8);
break;
}
}