We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f49edf commit 34d103eCopy full SHA for 34d103e
packages/web/src/middleware.ts
@@ -66,9 +66,9 @@ function localeFromAcceptLanguage(header: string | null) {
66
q: q ? Number.parseFloat(q) : 1,
67
}
68
})
69
- .sort((a, b) => b.q - a.q)
+ const sorted = [...items].sort((a, b) => b.q - a.q)
70
71
- const locale = items
+ const locale = sorted
72
.map((item) => item.lang)
73
.filter((lang) => lang && lang !== "*")
74
.map((lang) => matchLocale(lang))
0 commit comments