github.com/aliyun/aliyun-oss-go-sdk@v3.0.2+incompatible/oss/redirect_1_7.go (about)

     1  //go:build go1.7
     2  // +build go1.7
     3  
     4  package oss
     5  
     6  import "net/http"
     7  
     8  // http.ErrUseLastResponse only is defined go1.7 onward
     9  func disableHTTPRedirect(client *http.Client) {
    10  	client.CheckRedirect = func(req *http.Request, via []*http.Request) error {
    11  		return http.ErrUseLastResponse
    12  	}
    13  }