From 16ba22f3dbbf090265738039fbcbb1acb2f7f3ac Mon Sep 17 00:00:00 2001 From: Brian Frank Date: Wed, 10 Jul 2024 17:20:50 -0400 Subject: [PATCH] sys: MimeType.parseParams enhance to handle empty values for Safari cookies --- src/sys/es/fan/MimeType.js | 14 +++++++++----- src/sys/java/fan/sys/MimeType.java | 18 ++++++++++++------ src/sys/js/fan/MimeType.js | 19 ++++++++++++------- src/testSys/fan/MimeTypeTest.fan | 22 +++++++++++++++------- src/web/test/CookieTest.fan | 10 +++++++++- 5 files changed, 57 insertions(+), 26 deletions(-) diff --git a/src/sys/es/fan/MimeType.js b/src/sys/es/fan/MimeType.js index 9f766764e..cc6592183 100644 --- a/src/sys/es/fan/MimeType.js +++ b/src/sys/es/fan/MimeType.js @@ -89,13 +89,14 @@ class MimeType extends Obj { static #doParseParams(s, offset) { const params = Map.make(Str.type$, Str.type$); params.caseInsensitive(true); + let len = s.length; let inQuotes = false; let keyStart = offset; let valStart = -1; let valEnd = -1; let eq = -1; let hasEsc = false; - for (let i=keyStart; i