public void write_a_header_that_does_not_allow_multiple_values()
        {
            var settings    = new OwinHeaderSettings();
            var environment = new Dictionary <string, object>
            {
                { OwinConstants.HeaderSettings, settings }
            };
            var response = new OwinHttpResponse(environment);

            settings.DoNotAllowMultipleValues(HttpRequestHeaders.ContentLength);

            response.AppendHeader(HttpRequestHeaders.ContentLength, "1234");
            response.AppendHeader(HttpRequestHeaders.ContentLength, "1234");

            var headers = environment.Get <IDictionary <string, string[]> >(OwinConstants.ResponseHeadersKey);

            headers[HttpRequestHeaders.ContentLength].ShouldHaveTheSameElementsAs("1234");
        }
Example #2
0
 public void allow_multiple_returns_false_if_header_has_been_excluded()
 {
     theSettings.DoNotAllowMultipleValues(HttpRequestHeaders.ContentType);
     theSettings.AllowMultiple(HttpRequestHeaders.ContentType).ShouldBeFalse();
 }