Skip to content

Commit

Permalink
fix: add trailing slash to ignoreRoutes (#457)
Browse files Browse the repository at this point in the history
Fixes #455.
  • Loading branch information
rsslldnphy authored and isaachinman committed Aug 16, 2019
1 parent 7ac73e6 commit a13e6f4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ MyPage.getInitialProps = async({ req }) => {
| `browserLanguageDetection` | `true` |
| `defaultNS` | `'common'` |
| `defaultLanguage` | `'en'` |
| `ignoreRoutes` | `['/_next', '/static']` |
| `ignoreRoutes` | `['/_next/', '/static/']` |
| `otherLanguages` (required) | `[]` |
| `localeExtension` | `'json'` |
| `localePath` | `'static/locales'` |
Expand Down
2 changes: 1 addition & 1 deletion __tests__/middlewares/next-i18next-middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('next-18next middleware', () => {
expect(i18nextMiddleware.handle)
.toBeCalledWith('i18n',
expect.objectContaining({
ignoreRoutes: expect.arrayContaining(['/_next', '/static']),
ignoreRoutes: expect.arrayContaining(['/_next/', '/static/']),
}))
})

Expand Down
2 changes: 1 addition & 1 deletion __tests__/test-i18next-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
allLanguages: ['en', 'de'],
defaultLanguage: 'en',
otherLanguages: ['de'],
ignoreRoutes: ['/_next', '/static'],
ignoreRoutes: ['/_next/', '/static/'],
serverLanguageDetection: true,
},
}
2 changes: 1 addition & 1 deletion src/config/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const config = {
},
browserLanguageDetection: true,
serverLanguageDetection: true,
ignoreRoutes: ['/_next', '/static'],
ignoreRoutes: ['/_next/', '/static/'],
customDetectors: [],
detection: {
lookupCookie: 'next-i18next',
Expand Down

0 comments on commit a13e6f4

Please sign in to comment.