mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
Add PermanentAvatar to user.
This commit is contained in:
@ -16,6 +16,7 @@ package proxy
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"golang.org/x/net/proxy"
|
||||
@ -31,7 +32,7 @@ func InitHttpClient() {
|
||||
// use proxy
|
||||
httpProxy := beego.AppConfig.String("httpProxy")
|
||||
if httpProxy == "" {
|
||||
ProxyHttpClient = &http.Client{}
|
||||
ProxyHttpClient = DefaultHttpClient
|
||||
return
|
||||
}
|
||||
|
||||
@ -53,3 +54,11 @@ func InitHttpClient() {
|
||||
//defer resp.Body.Close()
|
||||
//println("Response status: %s", resp.Status)
|
||||
}
|
||||
|
||||
func GetHttpClient(url string) *http.Client {
|
||||
if strings.Contains(url, "githubusercontent.com") {
|
||||
return ProxyHttpClient
|
||||
} else {
|
||||
return DefaultHttpClient
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user