git-lfs/lfshttp/cookies.go

21 lines
450 B
Go
Raw Normal View History

package lfshttp
import (
"fmt"
"net/http"
"github.com/google/slothfs/cookie"
)
func isCookieJarEnabledForHost(c *Client, host string) bool {
_, cookieFileOk := c.uc.Get("http", fmt.Sprintf("https://%v", host), "cookieFile")
return cookieFileOk
}
func getCookieJarForHost(c *Client, host string) (http.CookieJar, error) {
2019-09-22 09:58:08 +00:00
cookieFile, _ := c.uc.Get("http", fmt.Sprintf("https://%v", host), "cookieFile")
return cookie.NewJar(cookieFile)
}