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

replaced slasher functionality #249

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

replaced slasher functionality #249

wants to merge 5 commits into from

Conversation

HaykoKoryun
Copy link

Fixes the issue encountered in #231.

glob-slasher replaces /s in the source with \s (at least on Windows) which results in URLs not matching against the given source pattern.
For example the following source /embed/:id/:ft is transformed into \embed\:id\:ft which fails the following condition this.source.match(/(?:^|\/):/).

This commit passes all tests in test/unit/middleware/redirects.spec.js so I think I have covered all three cases for the source:

  1. source starts with / | do nothing
  2. source starts with ! but does not have a leading slash | add slash after !
  3. source does not have a leading slash | add a leading slash

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.

1 participant