We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As discussed, route matching appears to be ignoring the HTTP method. In the test below the GET route is always hit, even when making a POST.
namespace Superscribe.Tests.Owin { class RoutingTests { static TestServer owinTestServer; static HttpClient client; static HttpResponseMessage response; Establish context = () => { owinTestServer = TestServer.Create(app => { var define = OwinRouteEngineFactory.Create(); define.Get("products", ctx => "Hello"); define.Post("products", ctx => { ctx.StatusCode = (int)HttpStatusCode.Created; return "Created"; }); app.UseSuperscribeRouter(define) .UseSuperscribeHandler(define); }); client = owinTestServer.HttpClient; client.DefaultRequestHeaders.Add("accept", "text/html"); }; class When_requesting_a_valid_route_with_matching_verb { Because of = () => response = client.GetAsync("http://localhost/products").Await(); It Should_return_200 = () => { response.StatusCode.ShouldEqual(HttpStatusCode.OK); }; } class When_requesting_a_valid_route_different_verb { Because of = () => response = client.PostAsync("http://localhost/products", new StringContent("test")).Await(); It Should_not_match_the_route = () => { response.StatusCode.ShouldEqual(HttpStatusCode.Created); }; } } }
Also I noticed that a template of products would also match products/add.
products
products/add
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As discussed, route matching appears to be ignoring the HTTP method. In the test below the GET route is always hit, even when making a POST.
Also I noticed that a template of
products
would also matchproducts/add
.The text was updated successfully, but these errors were encountered: