Unverified Commit 96809108 authored by Joel's avatar Joel Committed by GitHub

fix: locale match error (#115)

parent 8fc26636
......@@ -23,7 +23,11 @@ export const getLocale = (request: NextRequest): Locale => {
}
// match locale
const matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
let matchedLocale:Locale = i18n.defaultLocale
try {
// If languages is ['*'], Error would happen in match function.
matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
} catch(e) {}
return matchedLocale
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment