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

prePath middleware strips multiple slashes to an empty string #1953

Open
3 tasks done
mridgway opened this issue May 4, 2023 · 0 comments
Open
3 tasks done

prePath middleware strips multiple slashes to an empty string #1953

mridgway opened this issue May 4, 2023 · 0 comments

Comments

@mridgway
Copy link
Contributor

mridgway commented May 4, 2023

  • Used appropriate template for the issue type
  • Searched both open and closed issues for duplicates of this issue
  • Title adequately and concisely reflects the feature or the bug

Restify Version: master
Node.js Version: 16.17.0

Expected behaviour

prePath middleware should reduce path /// to /.

Actual behaviour

prePath middleware reduces /// to `` (empty string).

Repro case

Test case: master...mridgway:node-restify:prePathEmptyString

Cause

This code will parse an empty string which returns null for pathname. The router will then assert the pathname as a string and throw.

Are you willing and able to fix this?

Yes, if/when I have some time.

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

1 participant