mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 05:06:51 +00:00
refactor: make cookie architecture less crazy
This commit is contained in:
@ -36,7 +36,7 @@ func TestJar(t *testing.T) {
|
||||
ts := getTestServer(t, testCookies...)
|
||||
defer ts.Close()
|
||||
|
||||
jar, err := NewCookieJar(NewPersister(make(testPersister)))
|
||||
jar, err := NewCookieJar(make(testGetterSetter))
|
||||
require.NoError(t, err)
|
||||
|
||||
client := &http.Client{Jar: jar}
|
||||
@ -86,12 +86,12 @@ func getTestServer(t *testing.T, wantCookies ...testCookie) *httptest.Server {
|
||||
return httptest.NewServer(mux)
|
||||
}
|
||||
|
||||
type testPersister map[string]string
|
||||
type testGetterSetter map[string]string
|
||||
|
||||
func (p testPersister) Set(key, value string) {
|
||||
func (p testGetterSetter) Set(key, value string) {
|
||||
p[key] = value
|
||||
}
|
||||
|
||||
func (p testPersister) Get(key string) string {
|
||||
func (p testGetterSetter) Get(key string) string {
|
||||
return p[key]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user