internal/sessions: add cookie chunking

This commit is contained in:
Bobby DeSimone 2019-07-12 15:39:03 -07:00
parent 51e15daffd
commit bade7461ca
No known key found for this signature in database
GPG key ID: AEE4CF12FE86D07E
4 changed files with 73 additions and 9 deletions

View file

@ -2,6 +2,7 @@ package sessions
import (
"crypto/rand"
"fmt"
"reflect"
"testing"
"time"
@ -157,7 +158,7 @@ func TestMarshalSession(t *testing.T) {
wantErr bool
}{
{"simple", &SessionState{}, false},
{"too big", &SessionState{AccessToken: string(hugeString)}, true},
{"too big", &SessionState{AccessToken: fmt.Sprintf("%x", hugeString)}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {