Skip to content
This repository was archived by the owner on Nov 27, 2018. It is now read-only.

Routing is matching empty segments to parameters and defaults are wrong #359

Closed
rynowak opened this issue Sep 1, 2016 · 2 comments
Closed
Assignees

Comments

@rynowak
Copy link
Member

rynowak commented Sep 1, 2016

Consider the following:

    public class ValuesController : Controller
    {
        [HttpGet("{a=a}/{b=b}/{c=c}")]
        public string Get(string a, string b, string c)
        {
            return $"{a} - {b} - {c}";
        }
    }

This should match a url like / or /10 or /10/20 or /10/20/30

However with a URL like ///hi this will match. And the output will be b - c - hi. That is, the parameter a gets the default value b and is able to match an empty string.

@Eilon Eilon added this to the 1.1.0 milestone Sep 11, 2016
@Eilon
Copy link
Member

Eilon commented Sep 11, 2016

Let's add like a million tests for these cases...

@Eilon
Copy link
Member

Eilon commented Oct 3, 2016

Done?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants