public void it_should_allow_methods() { var controller = new OptionsController(HttpStatusCode.MethodNotAllowed, "GET"); controller.Response = new StringResponseInfo(String.Empty, new RequestInfo(Verb.POST, (HttpUrl)UrlParser.Parse("/"), new MemoryStream(), new BasicClaimBasedIdentity())); controller.Allow(); controller.Response.Headers["Allow"].Should().Be("GET"); }
public void it_should_allow_methods() { var controller = new OptionsController(HttpStatusCode.MethodNotAllowed, "GET"); controller.Response = new StringResponseInfo(String.Empty, new RequestInfo(Verb.POST, (HttpUrl)UrlParser.Parse("/"), new MemoryStream(), new BasicClaimBasedIdentity())); controller.Allow(); controller.Response.Headers["Allow"].Should().Be("GET"); }
public void it_should_allow_methods_in_CORS_request() { var controller = new OptionsController(HttpStatusCode.MethodNotAllowed, "GET"); var request = new RequestInfo(Verb.OPTIONS, (HttpUrl)UrlParser.Parse("/"), new MemoryStream(), new BasicClaimBasedIdentity(), new Header("Origin", "temp.uri"), new Header("Access-Control-Request-Method", "GET")); controller.Response = new StringResponseInfo(String.Empty, request); controller.Allow(); controller.Response.Headers["Access-Control-Allow-Methods"].Should().Be("GET"); }
public void it_should_allow_methods_in_CORS_request() { var controller = new OptionsController(HttpStatusCode.MethodNotAllowed, "GET"); var request = new RequestInfo(Verb.OPTIONS, (HttpUrl)UrlParser.Parse("/"), new MemoryStream(), new BasicClaimBasedIdentity(), new Header("Origin", "temp.uri"), new Header("Access-Control-Request-Method", "GET")); controller.Response = new StringResponseInfo(String.Empty, request); controller.Allow(); controller.Response.Headers["Access-Control-Allow-Methods"].Should().Be("GET"); }