MCPcopy Create free account
hub / github.com/PostHog/duckgres / writeTo

Method writeTo

cmd/cache-proxy/proxy.go:637–648  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

635func 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 }

Callers 1

HandleProxyMethod · 0.95

Calls 3

AddMethod · 0.80
HeaderMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected