Skip to content

Commit

Permalink
Undo = loop
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Oct 2, 2024
1 parent eca9f8f commit 2f6236a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ function parse(str, options) {
var index = 0;

while (index < str.length) {
var eqIdx = str.indexOf('=', index);
if (eqIdx === -1) break; // No more cookies.

var endIdx = str.indexOf(';', index);
if (endIdx === -1) endIdx = str.length;

var eqIdx = index;
while (eqIdx < endIdx && str.charCodeAt(eqIdx) !== 0x3D /* = */) eqIdx++;

if (eqIdx === endIdx) {
index = endIdx + 1;
if (eqIdx > endIdx) {
index = str.lastIndexOf(';', eqIdx) + 1;
continue;
}

Expand Down

0 comments on commit 2f6236a

Please sign in to comment.