private void VerifyContentTypeHeader(WebHeaderCollection headers)
{
string contentType = headers["Content-Type"];
int responseCodeValue;
int.TryParse(headers["X-ResponseCode"], out responseCodeValue);
if (responseCodeValue == 0)
{
// Add the debug information
this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R2037");
// Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R2037
this.Site.CaptureRequirementIfAreEqual<string>(
"application/mapi-http",
contentType,
2037,
@"[In Content-Type Header Field] The Content-Type header MUST contain the string ""application/mapi-http"" on responses with X-ResponseCode header of 0.");
}
else
{
// Add the debug information
this.Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCMAPIHTTP_R2038");
// Verify MS-OXCMAPIHTTP requirement: MS-OXCMAPIHTTP_R2038
this.Site.CaptureRequirementIfAreEqual<string>(
"text/html",
contentType,
2038,
@"[In Content-Type Header Field] If X-ResponseCode is non-zero, the Content-Type header MUST contain the string ""text/html"".");
}
}