Skip to content

Doesn't correctly escape slashes #29

@carmandrew

Description

@carmandrew
const a = new RouteParser('/foo/:bar')
a.reverse({bar: 'hi/test'})
// Returns "/foo/hi/test"

a.reverse({bar: 'hi test'})
// Returns "/foo/hi%20test"

Either the first should return "/foo/hi%2ftest" (by calling EncodeURIComponent on each param) or the second should return "/foo/hi test"(so that the caller can encode the components). But with the current behavior, there is no way to encode a string like "foo hi/test" because there is no way to encode both the slash without double encoding the space (ie. into "%2520")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions