writeTo replays the captured origin response onto w. Any header the origin set that isn't a hop-by-hop is forwarded; status code and body follow.
(w http.ResponseWriter)
| 635 | func isRetriableOriginFetchError(err error) bool { |
| 636 | if err == nil { |
| 637 | return false |
| 638 | } |
| 639 | var oe *originStatusError |
| 640 | if errors.As(err, &oe) { |
| 641 | switch oe.status { |
| 642 | case http.StatusRequestTimeout, |
| 643 | http.StatusTooManyRequests, |
| 644 | http.StatusInternalServerError, |
| 645 | http.StatusBadGateway, |
| 646 | http.StatusServiceUnavailable, |
| 647 | http.StatusGatewayTimeout: |
| 648 | return true |
| 649 | default: |
| 650 | return false |
| 651 | } |
no test coverage detected