Skip to content

Commit

Permalink
fix: update coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <[email protected]>
  • Loading branch information
fzipi committed Dec 18, 2023
1 parent 129233a commit ef46298
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/cookies/cookies.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
func ParseCookies(rawCookies string) map[string][]string {
cookies := make(map[string][]string)

if len(rawCookies) == 0 {
rawCookies = textproto.TrimString(rawCookies)

if rawCookies == "" {
return cookies
}

rawCookies = textproto.TrimString(rawCookies)

var part string
for len(rawCookies) > 0 { // continue since we have rest
part, rawCookies, _ = strings.Cut(rawCookies, ";")
Expand Down
5 changes: 5 additions & 0 deletions internal/cookies/cookies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ func TestParseCookies(t *testing.T) {
args args
want map[string][]string
}{
{
name: "EmptyString",
args: args{rawCookies: " "},
want: map[string][]string{},
},
{
name: "SimpleCookie",
args: args{rawCookies: "test=test_value"},
Expand Down

0 comments on commit ef46298

Please sign in to comment.