mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
Fixed an error caused of character when @ > 1 during proxy authentication (#1452)
* Fixed a error caused by more @ character during proxy authentication * Fixed a error caused by more @ character during proxy authentication
This commit is contained in:
@@ -34,9 +34,9 @@ func FasthttpHTTPDialer(proxy string) fasthttp.DialFunc {
|
||||
func FasthttpHTTPDialerTimeout(proxy string, timeout time.Duration) fasthttp.DialFunc {
|
||||
var auth string
|
||||
if strings.Contains(proxy, "@") {
|
||||
split := strings.Split(proxy, "@")
|
||||
auth = base64.StdEncoding.EncodeToString([]byte(split[0]))
|
||||
proxy = split[1]
|
||||
index := strings.LastIndex(proxy, "@")
|
||||
auth = base64.StdEncoding.EncodeToString([]byte(proxy[:index]))
|
||||
proxy = proxy[index+1:]
|
||||
}
|
||||
|
||||
return func(addr string) (net.Conn, error) {
|
||||
|
||||
Reference in New Issue
Block a user