Skip to content
New issue

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

Path's joined wrong if encoding is disabled #39

Open
daniil4udo opened this issue Nov 6, 2022 · 1 comment
Open

Path's joined wrong if encoding is disabled #39

daniil4udo opened this issue Nov 6, 2022 · 1 comment

Comments

@daniil4udo
Copy link

I am trying to join path for the router (which is using path-to-regexp).

const path = properUrlJoin('some-path', '/:id?/:subnav?/:step?', {
    trailingSlash: true,
    queryOptions: {
        encode: false,
    },
})

expected output should be

/some-path/:id?/:subnav?/:step?/

but it results to

/flow/:id/?/:subnav?/:step? 
@daniil4udo daniil4udo changed the title Wrong joined path if encoding is disabled Path's joined wrong if encoding is disabled Nov 6, 2022
@satazor
Copy link
Contributor

satazor commented Nov 6, 2022

I guess that’s because ? has a special meaning in the url. It’s being interpreted as a query string.

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

No branches or pull requests

2 participants