-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby): Add ignoreCase option for createRedirect and support it in client sid… #29714
feat(gatsby): Add ignoreCase option for createRedirect and support it in client sid… #29714
Conversation
Also gatsby/packages/gatsby/index.d.ts Lines 1199 to 1211 in d042039
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add test to production-runtime?
You'll need to add ignoreCase to the CREATE_REDIRECT action.
For my comment to work you will also need to do the following:
gatsby/packages/gatsby/src/query/redirects-writer.ts
Lines 16 to 19 in d042039
const browserRedirects = redirects | |
.filter(r => r.redirectInBrowser) | |
// eslint-disable-next-line @typescript-eslint/no-unused-vars | |
.map(({ redirectInBrowser, isPermanent, ...rest }) => rest) |
const browserRedirects = redirects
.filter(r => r.redirectInBrowser)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.map(({ redirectInBrowser, isPermanent, ignoreCase, fromPath, ...rest }) => {
return {
fromPath: ignoreCase ? fromPath.toLowerCase() : fromPath,
...rest,
}
})
2a420b3
to
d5d0544
Compare
b2b8cd4
to
6ab5519
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small nit about let & const but this looks 👍.
Let's see if tests pass
8dd6eac
to
2a1fda1
Compare
Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
Co-authored-by: Ward Peeters <ward@coding-tech.com>
Co-authored-by: Ward Peeters <ward@coding-tech.com>
2a1fda1
to
f19ddb1
Compare
…e navigation
This is a breaking change for Gatsby v3