Add PermanentAvatar to user.

This commit is contained in:
Yang Luo
2021-08-21 23:17:33 +08:00
parent 9c3117beb0
commit e50c6cd4b5
7 changed files with 166 additions and 17 deletions

View File

@ -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
}
}