]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: fix Accept-Language header parsing 42183/head
author胡玮文 <huww98@outlook.com>
Mon, 5 Jul 2021 13:27:57 +0000 (21:27 +0800)
committer胡玮文 <huww98@outlook.com>
Mon, 5 Jul 2021 13:39:14 +0000 (21:39 +0800)
commitc7b2d079a3323765e2c56e24309c89728c1b8b6a
treec024e5e36b26cb95a50bba184df857bdf37ff7ac
parent3510d2e6a5014a0190a0ef7bb309af63e9aca6ab
mgr/dashboard: fix Accept-Language header parsing

Fix 400 error caused by multi-subtag language in Accept-Language header.
Reproduced by Firefox for Android in Chinese.

The regex expression is fixed according to https://datatracker.ietf.org/doc/html/rfc4647#section-2.1

Fixes: https://tracker.ceph.com/issues/51528
Signed-off-by: 胡玮文 <huww98@outlook.com>
src/pybind/mgr/dashboard/controllers/home.py
src/pybind/mgr/dashboard/tests/test_home.py