glide up
This commit is contained in:
		
							
								
								
									
										12
									
								
								vendor/golang.org/x/net/http2/h2i/h2i.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								vendor/golang.org/x/net/http2/h2i/h2i.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -88,14 +88,6 @@ func withPort(host string) string {
 | 
			
		||||
	return host
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// withoutPort strips the port from addr if present.
 | 
			
		||||
func withoutPort(addr string) string {
 | 
			
		||||
	if h, _, err := net.SplitHostPort(addr); err == nil {
 | 
			
		||||
		return h
 | 
			
		||||
	}
 | 
			
		||||
	return addr
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// h2i is the app's state.
 | 
			
		||||
type h2i struct {
 | 
			
		||||
	host   string
 | 
			
		||||
@@ -142,7 +134,7 @@ func main() {
 | 
			
		||||
 | 
			
		||||
func (app *h2i) Main() error {
 | 
			
		||||
	cfg := &tls.Config{
 | 
			
		||||
		ServerName:         withoutPort(app.host),
 | 
			
		||||
		ServerName:         app.host,
 | 
			
		||||
		NextProtos:         strings.Split(*flagNextProto, ","),
 | 
			
		||||
		InsecureSkipVerify: *flagInsecure,
 | 
			
		||||
	}
 | 
			
		||||
@@ -481,7 +473,7 @@ func (app *h2i) encodeHeaders(req *http.Request) []byte {
 | 
			
		||||
		host = req.URL.Host
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	path := req.RequestURI
 | 
			
		||||
	path := req.URL.Path
 | 
			
		||||
	if path == "" {
 | 
			
		||||
		path = "/"
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user