(r *http.Request)
| 122 | } |
| 123 | |
| 124 | func isReplayable(r *http.Request) bool { |
| 125 | if r.Body == nil || r.Body == NoBody || r.GetBody != nil { |
| 126 | switch valueOrDefault(r.Method, "GET") { |
| 127 | case "GET", "HEAD", "OPTIONS", "TRACE": |
| 128 | return true |
| 129 | } |
| 130 | // The Idempotency-Key, while non-standard, is widely used to |
| 131 | // mean a POST or other request is idempotent. See |
| 132 | // https://golang.org/issue/19943#issuecomment-421092421 |
| 133 | if headerHas(r.Header, "Idempotency-Key") || headerHas(r.Header, "X-Idempotency-Key") { |
| 134 | return true |
| 135 | } |
| 136 | } |
| 137 | return false |
| 138 | } |
| 139 | |
| 140 | func reqExpectsContinue(r *http.Request) bool { |
| 141 | return hasToken(headerGet(r.Header, "Expect"), "100-continue") |
no test coverage detected
searching dependent graphs…