Use the right collection, so accessing a non existent ContentType on a response doesn't throw and return null instead

This commit is contained in:
Yishai Galatzer 2014-02-12 12:43:13 -08:00
parent fe1011e507
commit a34826d90b
1 changed files with 2 additions and 2 deletions

View File

@ -78,8 +78,8 @@ namespace Microsoft.AspNet.PipelineCore
{ {
get get
{ {
var contentTypeValues = HttpResponseInformation.Headers[Constants.Headers.ContentType]; var contentType = Headers[Constants.Headers.ContentType];
return contentTypeValues.Length == 0 ? null : contentTypeValues[0]; return contentType;
} }
set set
{ {