mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	Minor cleanup, resolve a couple lint warnings
This commit is contained in:
		
							parent
							
								
									e1801fdb19
								
							
						
					
					
						commit
						8cb3cf540c
					
				@ -123,8 +123,8 @@ func TestH2ToH2CStream(t *testing.T) {
 | 
			
		||||
	// Disable any compression method from server.
 | 
			
		||||
	req.Header.Set("Accept-Encoding", "identity")
 | 
			
		||||
 | 
			
		||||
	resp := tester.AssertResponseCode(req, 200)
 | 
			
		||||
	if 200 != resp.StatusCode {
 | 
			
		||||
	resp := tester.AssertResponseCode(req, http.StatusOK)
 | 
			
		||||
	if resp.StatusCode != http.StatusOK {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	go func() {
 | 
			
		||||
@ -143,7 +143,6 @@ func TestH2ToH2CStream(t *testing.T) {
 | 
			
		||||
	if !strings.Contains(body, expectedBody) {
 | 
			
		||||
		t.Errorf("requesting \"%s\" expected response body \"%s\" but got \"%s\"", req.RequestURI, expectedBody, body)
 | 
			
		||||
	}
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func testH2ToH2CStreamServeH2C(t *testing.T) *http.Server {
 | 
			
		||||
@ -335,8 +334,8 @@ func TestH2ToH1ChunkedResponse(t *testing.T) {
 | 
			
		||||
		fmt.Fprint(w, expectedBody)
 | 
			
		||||
		w.Close()
 | 
			
		||||
	}()
 | 
			
		||||
	resp := tester.AssertResponseCode(req, 200)
 | 
			
		||||
	if 200 != resp.StatusCode {
 | 
			
		||||
	resp := tester.AssertResponseCode(req, http.StatusOK)
 | 
			
		||||
	if resp.StatusCode != http.StatusOK {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -351,7 +350,6 @@ func TestH2ToH1ChunkedResponse(t *testing.T) {
 | 
			
		||||
	if body != expectedBody {
 | 
			
		||||
		t.Errorf("requesting \"%s\" expected response body \"%s\" but got \"%s\"", req.RequestURI, expectedBody, body)
 | 
			
		||||
	}
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func testH2ToH1ChunkedResponseServeH1(t *testing.T) *http.Server {
 | 
			
		||||
 | 
			
		||||
@ -46,7 +46,9 @@ import (
 | 
			
		||||
var supports1xx bool
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	supports1xx = !regexp.MustCompile(`^go1\.1(?:7|8)\.`).Match([]byte(runtime.Version()))
 | 
			
		||||
	// Caddy requires at least Go 1.18, but Early Hints requires Go 1.19; thus we can simply check for 1.18 in version string
 | 
			
		||||
	// TODO: remove this once our minimum Go version is 1.19
 | 
			
		||||
	supports1xx = !strings.Contains(runtime.Version(), "go1.18")
 | 
			
		||||
 | 
			
		||||
	caddy.RegisterModule(Handler{})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user