Skip to content

Decode URL-encoded path matches for Router's req.params.#335

Merged
yuibuild merged 4 commits into
yui:masterfrom
ericf:router-decode-path
Nov 9, 2012
Merged

Decode URL-encoded path matches for Router's req.params.#335
yuibuild merged 4 commits into
yui:masterfrom
ericf:router-decode-path

Conversation

@ericf

@ericf ericf commented Nov 8, 2012

Copy link
Copy Markdown
Member

Router already parses and decodes the URL's query string for req.query. This decodes any URL-encoded matches in the URL's path for req.params.

var router = new Y.Router();

router.route('/:foo', function (req) {
    Y.log(req.params.foo);
});

router.save('/path%20with%20spaces');
// => "path with spaces"

@yuibuild yuibuild merged commit 9ddf37c into yui:master Nov 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants