2019-09-18 16:14:02 +00:00
|
|
|
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")
|
2019-09-18 16:14:02 +00:00
|
|
|
|
|
|
|
return cookie.NewJar(cookieFile)
|
|
|
|
}
|