(req *http.Request)
| 935 | } |
| 936 | |
| 937 | func isHTTPUpgrade(req *http.Request) bool { |
| 938 | if req.Method == http.MethodConnect { |
| 939 | return true |
| 940 | } |
| 941 | if req.Header.Get("Upgrade") != "" { |
| 942 | return true |
| 943 | } |
| 944 | for _, v := range strings.Split(req.Header.Get("Connection"), ",") { |
| 945 | if strings.EqualFold(strings.TrimSpace(v), "upgrade") { |
| 946 | return true |
| 947 | } |
| 948 | } |
| 949 | return false |
| 950 | } |
| 951 | |
| 952 | // isIdempotentMethod returns whether RFC 9110 §9.2.2 permits automatic |
| 953 | // retry of the request after a stale-connection failure. |
no test coverage detected