fix(music): handle multiple cookie headers and invalid saved values

This commit is contained in:
TIANYAO ZHANG committed 2026-11-18 16:39:42 +08:00
1 parent 4ac3309e34
commit 51debb915c
4 files changed
+14 -5

No files matched your search

+5
View File
@@ -54,6 +54,11 @@ describe("normalizeCookie", () => {
expect(normalizeCookie("cookie: MUSIC_U=abc")).toBe("MUSIC_U=abc");
});
it("keeps each cookie from multiple pasted Set-Cookie lines", () => {
expect(normalizeCookie("Set-Cookie: MUSIC_U=abc; Path=/\r\nSet-Cookie: __csrf=def; HttpOnly"))
.toBe("MUSIC_U=abc; __csrf=def");
});
it("empties out a blob that carries no real cookie at all", () => {
expect(normalizeCookie("Max-Age=1; Expires=Thu, 25 Nov 2094 21:48:40 GMT; Path=/")).toBe("");
});