git-lfs/lfshttp/cookies.go
2019-09-28 19:02:20 +01:00

21 lines
450 B
Go

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) {
cookieFile, _ := c.uc.Get("http", fmt.Sprintf("https://%v", host), "cookieFile")
return cookie.NewJar(cookieFile)
}