Trim langs from accept header

This commit is contained in:
simojenki
2021-08-14 17:47:59 +10:00
parent 0d21c34243
commit ab73569393
2 changed files with 10 additions and 1 deletions

View File

@@ -21,6 +21,15 @@ describe("i8n", () => {
]);
});
});
describe("when there are multiple in the accept-langauge header with spaces", () => {
it("should split them out and return them", () => {
expect(asLANGs("es-ES, es, en-US;q=0.9, en;q=0.8")).toEqual([
"es-ES",
"es",
"en-US",
]);
});
});
});
describe("langs", () => {