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

Route Parameters No Longer Url Decoded #3342

Closed
shawnwildermuth opened this issue Oct 18, 2015 · 9 comments
Closed

Route Parameters No Longer Url Decoded #3342

shawnwildermuth opened this issue Oct 18, 2015 · 9 comments

Comments

@shawnwildermuth
Copy link

Is this a design change or a regression? I am seeing this in Beta8.

  [Route("api/values")]
  public class ValuesController : Controller
  {
    // GET: api/values
    [HttpGet]
    public JsonResult Get()
    {
      return Json(new string[] { "value1", "value2" });
    }

    // GET api/values/5
    [HttpGet("{id}")]
    public JsonResult Get(string id)
    {
      return Json(id);
    }

  }

For example, if I do a GET to /api/values/Hello%20World I get:

image

This is a breaking change from Beta 7. Just want to know whether I need to allow for this.

@Kukkimonsuta
Copy link

Seems more like Kestrel bug - when using Microsoft.AspNet.Server.WebListener, everything works fine. Looks like somewhere along the line the request path gets encoded again.

@rynowak
Copy link
Member

rynowak commented Oct 19, 2015

@shawnwildermuth - there's no intended change here, we need to look into this. @halter73

@shawnwildermuth
Copy link
Author

@rynowak and @Kukkimonsuta - I've replicated this behavior in Beta 7 with Kestrel. Clearly that's where the problem lies. It's not a new code change. I was using WebListener and IISExpress in the course before so that's why it worked. Once I moved the Beta 7 version and tried it in Kestrel it happened. Problem a bug. /cc @halter73

@Eilon
Copy link
Contributor

Eilon commented Oct 20, 2015

This is the same as aspnet/KestrelHttpServer#124, right?

@shawnwildermuth
Copy link
Author

@Eilon - looks the same, as long as we'll end up in RC with an unescaped parameter values, I'm happy.

@Eilon
Copy link
Contributor

Eilon commented Oct 20, 2015

Yep, we have an engineer working on it!

@troydai
Copy link
Contributor

troydai commented Oct 20, 2015

Hi @shawnwildermuth, I'm working on unescapes the Url path. As of now the fix is targeting rc1.

@shawnwildermuth
Copy link
Author

@troydai Perfect. Thanks!

@davidfowl
Copy link
Member

Closing

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

No branches or pull requests

6 participants