Closed ScottHamper closed 10 years ago
I think I have similar issue when trying to get key from cookie:
URIError: malformed URI sequence Cookies._getKeyValuePairFromCookieString()main_c...s_17.js (wiersz 111) Cookies._getCookieObjectFromString()main_c...s_17.js (wiersz 92) Cookies._renewCache()main_c...s_17.js (wiersz 116) Cookies.get()main_c...s_17.js (wiersz 27)
I will try to find cookie string that causes issue.
Grzegorz, Your error is likely due to a cookie value being encoded in something other than UTF-8.
See Issue #22
This time issue was caused by %uFFFD sequence which is the Unicode Replacement Character. This indicates that a given character value cannot be correctly encoded in Unicode.
I solved issue by updating Cookies._getKeyValuePairFromCookieString
with following bits of code: value: decodeURIComponent(cookieString.substr(separatorIndex + 1).replace(/%uFFFD/gi, ''))
See Issue 17 for background.
encodeURIComponent
is currently being used to encode cookie keys. However, this function escapes some characters that are allowed to be in a cookie key, and does not escape some characters that are not allowed to be in a cookie key, as defined by RFC6265.