be-fe / be-fe/gulp-bird

cookie为空时,parseCookie函数报错

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Description

exports.parseCookie = function (cookieStr) {
var tmpArr = cookieStr.split('; ');
var obj = {};
tmpArr.forEach(function(item, index) {
if (item.match(/^[^=]*(?==)/)) {
obj[item.match(/^[^=]*(?==)/)[0]] = item.match(/=(\S*)/)[1]
}
});
return obj;
};

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the parseCookie function shown in the issue and reproduce the failure with an empty cookie string. Confirm the change no longer throws while preserving the function's existing cookie-parsing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.