Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Update isRootCatchAllRedirect condition #77

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

afzalsayed96
Copy link
Contributor

Hi @lindsaylevine,

This fix seems to work for the issue reported in #43 (comment)

// (e.g., /[[...slug]] or /[...slug])
const isRootCatchAllRedirect = (redirect) =>
redirect.startsWith("/*") ||
(redirect.startsWith("/:") && redirect.includes("/*"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably could be improved with some regex or

(redirect.startsWith("/:") && redirect.trim().split(" ")[0].endsWith("/*");

@lindsaylevine lindsaylevine added the type: bug code to address defects in shipped code label Nov 13, 2020
@lindsaylevine
Copy link
Contributor

@afzalsayed96 this is great! thanks so much for opening this and helping out <3

@lindsaylevine lindsaylevine merged commit 1955358 into netlify:main Nov 13, 2020
icodethings pushed a commit to SleepingDuck/next-on-netlify that referenced this pull request Nov 15, 2020
* update isRootCatchAllRedirect condition
lindsaylevine added a commit that referenced this pull request Nov 15, 2020
- Hotfix: no-cache Cache-Control for preview mode ([Commit](990b4a8))
- README updates
- Update isRootCatchAllRedirect condition ([#77](#77))
@lindsaylevine
Copy link
Contributor

this has been published!

icodethings pushed a commit to SleepingDuck/next-on-netlify that referenced this pull request Nov 15, 2020
- Hotfix: no-cache Cache-Control for preview mode ([Commit](netlify@990b4a8))
- README updates
- Update isRootCatchAllRedirect condition ([netlify#77](netlify#77))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants