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

Tweak to rules regex to only match final square brackets #51

Merged

Conversation

jgchristian
Copy link

If either the source or destination strings contain an opening square bracket, the current Rules regex will match the anything after the first square bracket. Therefore, too much of the rule is considered when determining which action to take

e.g. for the rule /a[z] /bG [L] the Rules regex will match [z] /bG [L]

Then the "Gone" rule will match on the captial G in the destination string and rather than treating this as a standard rewrite, will try to return a 410 status code

@jgchristian
Copy link
Author

Hi. That regex will put us back to the current state and the unit test I wrote will fail again

Here's some example urls

@tinganho
Copy link
Owner

@jgchristian thanks the non-greedy seem to not work with $.

tinganho added a commit that referenced this pull request Jul 30, 2015
…ckets

Tweak to rules regex to only match final square brackets
@tinganho tinganho merged commit bb1852a into tinganho:master Jul 30, 2015
@tinganho
Copy link
Owner

Published now on connect-modrewrite@0.8.2. Please try it out.

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.

3 participants