|
|
|
@@ -974,10 +974,10 @@ func getJupyterBaseUrl(url string) string { |
|
|
|
} |
|
|
|
|
|
|
|
func getCookiesAndCsrf(client *resty.Client, jupyterUrl string) ([]*http.Cookie, string) { |
|
|
|
|
|
|
|
log.Info("jupyter url:"+jupyterUrl) |
|
|
|
var cookies []*http.Cookie |
|
|
|
for i := 0; i < 10; i++ { |
|
|
|
res, err := client.R().SetCookies(cookies).Get(jupyterUrl) |
|
|
|
res, err := http.Get(jupyterUrl) |
|
|
|
if err != nil { |
|
|
|
log.Error("browser jupyterUrl failed.") |
|
|
|
return cookies, "" |
|
|
|
@@ -987,6 +987,7 @@ func getCookiesAndCsrf(client *resty.Client, jupyterUrl string) ([]*http.Cookie, |
|
|
|
for _, cookie := range cookies { |
|
|
|
if cookie.Name == "_xsrf" { |
|
|
|
xsrf = cookie.Value |
|
|
|
break |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|