Skip to content

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