mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 04:32:25 -05:00 
			
		
		
		
	[chore]: Bump github.com/gorilla/websocket from 1.5.0 to 1.5.1 (#2335)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
		
					parent
					
						
							
								33ee61575f
							
						
					
				
			
			
				commit
				
					
						2eb8b8eeb4
					
				
			
		
					 29 changed files with 1203 additions and 632 deletions
				
			
		
							
								
								
									
										17
									
								
								vendor/github.com/gorilla/websocket/proxy.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								vendor/github.com/gorilla/websocket/proxy.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -8,10 +8,13 @@ import ( | |||
| 	"bufio" | ||||
| 	"encoding/base64" | ||||
| 	"errors" | ||||
| 	"log" | ||||
| 	"net" | ||||
| 	"net/http" | ||||
| 	"net/url" | ||||
| 	"strings" | ||||
| 
 | ||||
| 	"golang.org/x/net/proxy" | ||||
| ) | ||||
| 
 | ||||
| type netDialerFunc func(network, addr string) (net.Conn, error) | ||||
|  | @ -21,7 +24,7 @@ func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) { | |||
| } | ||||
| 
 | ||||
| func init() { | ||||
| 	proxy_RegisterDialerType("http", func(proxyURL *url.URL, forwardDialer proxy_Dialer) (proxy_Dialer, error) { | ||||
| 	proxy.RegisterDialerType("http", func(proxyURL *url.URL, forwardDialer proxy.Dialer) (proxy.Dialer, error) { | ||||
| 		return &httpProxyDialer{proxyURL: proxyURL, forwardDial: forwardDialer.Dial}, nil | ||||
| 	}) | ||||
| } | ||||
|  | @ -55,7 +58,9 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) | |||
| 	} | ||||
| 
 | ||||
| 	if err := connectReq.Write(conn); err != nil { | ||||
| 		conn.Close() | ||||
| 		if err := conn.Close(); err != nil { | ||||
| 			log.Printf("httpProxyDialer: failed to close connection: %v", err) | ||||
| 		} | ||||
| 		return nil, err | ||||
| 	} | ||||
| 
 | ||||
|  | @ -64,12 +69,16 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) | |||
| 	br := bufio.NewReader(conn) | ||||
| 	resp, err := http.ReadResponse(br, connectReq) | ||||
| 	if err != nil { | ||||
| 		conn.Close() | ||||
| 		if err := conn.Close(); err != nil { | ||||
| 			log.Printf("httpProxyDialer: failed to close connection: %v", err) | ||||
| 		} | ||||
| 		return nil, err | ||||
| 	} | ||||
| 
 | ||||
| 	if resp.StatusCode != 200 { | ||||
| 		conn.Close() | ||||
| 		if err := conn.Close(); err != nil { | ||||
| 			log.Printf("httpProxyDialer: failed to close connection: %v", err) | ||||
| 		} | ||||
| 		f := strings.SplitN(resp.Status, " ", 2) | ||||
| 		return nil, errors.New(f[1]) | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue